diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-10-20 07:58:57 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-10-20 07:58:57 -0400 |
commit | 249ad14dfedbe45919b48dbbff445394a64d985c (patch) | |
tree | f88f6356df0087c28e8d18a434e5e9142359352f /tests/test_process.py | |
parent | f0459a54bb3e703691359aa3078a8234173ec361 (diff) | |
download | python-coveragepy-249ad14dfedbe45919b48dbbff445394a64d985c.tar.gz |
with statements: no more finally close
Diffstat (limited to 'tests/test_process.py')
-rw-r--r-- | tests/test_process.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/test_process.py b/tests/test_process.py index 4453fc5..1ab56e8 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -572,16 +572,13 @@ class ProcessStartupTest(CoverageTest): g = glob.glob(os.path.join(d, "*.pth")) if g: pth_path = os.path.join(d, "subcover.pth") - pth = open(pth_path, "w") - try: + with open(pth_path, "w") as pth: try: pth.write(pth_contents) self.pth_path = pth_path break except (IOError, OSError): # pragma: not covered pass - finally: - pth.close() else: # pragma: not covered raise Exception("Couldn't find a place for the .pth file") |