aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYilei "Dolee" Yang <yileiyang@google.com>2021-11-17 09:58:41 -0800
committerGitHub <noreply@github.com>2021-11-17 09:58:41 -0800
commita1c1af693b9f15bd0f67fe383cb05e7cc955556b (patch)
treeab1ae172557b4ae3931ca634826ef5f7131b2692
parent0f86230d77cd90ea1236f0cbee4df9a9b290ef66 (diff)
parenta9bb1279de28446a06631c725375d26f32a8312a (diff)
downloadabsl-py-a1c1af693b9f15bd0f67fe383cb05e7cc955556b.tar.gz
Merge pull request #181 from yilei/push_up_to_410547961
Push up to 410547961
-rw-r--r--CONTRIBUTING.md6
-rw-r--r--README.md2
-rw-r--r--absl/testing/absltest.py14
3 files changed, 9 insertions, 13 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 52b2e09..5134aff 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -51,11 +51,11 @@ will be expected to conform to the Python style outlined
* Maintain **clean commit history** and use **meaningful commit messages**.
PRs with messy commit history are difficult to review and won't be merged.
- Use `rebase -i upstream/master` to curate your commit history and/or to
- bring in latest changes from master (but avoid rebasing in the middle of a
+ Use `rebase -i upstream/main` to curate your commit history and/or to
+ bring in latest changes from main (but avoid rebasing in the middle of a
code review).
-* Keep your PR up to date with upstream/master (if there are merge conflicts,
+* Keep your PR up to date with upstream/main (if there are merge conflicts,
we can't really merge your change).
* **All tests need to be passing** before your change can be merged. We
diff --git a/README.md b/README.md
index 4d84f83..5ab2365 100644
--- a/README.md
+++ b/README.md
@@ -41,7 +41,7 @@ bazel test absl/...
### Example Code
Please refer to
-[smoke_tests/sample_app.py](https://github.com/abseil/abseil-py/blob/master/smoke_tests/sample_app.py)
+[smoke_tests/sample_app.py](https://github.com/abseil/abseil-py/blob/main/smoke_tests/sample_app.py)
as an example to get started.
## Documentation
diff --git a/absl/testing/absltest.py b/absl/testing/absltest.py
index 4779663..ffad3da 100644
--- a/absl/testing/absltest.py
+++ b/absl/testing/absltest.py
@@ -2394,16 +2394,12 @@ def _setup_sharding(custom_loader=None):
# to query whether a test binary implements the test sharding protocol.
if 'TEST_SHARD_STATUS_FILE' in os.environ:
try:
- f = None
- try:
- f = open(os.environ['TEST_SHARD_STATUS_FILE'], 'w')
+ with open(os.environ['TEST_SHARD_STATUS_FILE'], 'w') as f:
f.write('')
- except IOError:
- sys.stderr.write('Error opening TEST_SHARD_STATUS_FILE (%s). Exiting.'
- % os.environ['TEST_SHARD_STATUS_FILE'])
- sys.exit(1)
- finally:
- if f is not None: f.close()
+ except IOError:
+ sys.stderr.write('Error opening TEST_SHARD_STATUS_FILE (%s). Exiting.'
+ % os.environ['TEST_SHARD_STATUS_FILE'])
+ sys.exit(1)
base_loader = custom_loader or TestLoader()
if 'TEST_TOTAL_SHARDS' not in os.environ: