diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-01 17:06:47 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-01 17:06:47 -0500 |
commit | 189b1c027e626496b7b7bb1b5996123f54286075 (patch) | |
tree | 4a440ce1cf4ae0ba2862e6c8db1d7d7be1a3f38b | |
parent | 64a1da4d9c2e85d28e9c4040bcccb5abbdd689ce (diff) | |
download | python-setuptools-git-189b1c027e626496b7b7bb1b5996123f54286075.tar.gz |
Use context opener
-rw-r--r-- | setuptools/tests/test_bdist_egg.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/setuptools/tests/test_bdist_egg.py b/setuptools/tests/test_bdist_egg.py index 208f63dd..58d25b70 100644 --- a/setuptools/tests/test_bdist_egg.py +++ b/setuptools/tests/test_bdist_egg.py @@ -23,12 +23,10 @@ class TestDevelopTest(unittest.TestCase): self.dir = tempfile.mkdtemp() self.old_cwd = os.getcwd() os.chdir(self.dir) - f = open('setup.py', 'w') - f.write(SETUP_PY) - f.close() - f = open('hi.py', 'w') - f.write('1\n') - f.close() + with open('setup.py', 'w') as f: + f.write(SETUP_PY) + with open('hi.py', 'w') as f: + f.write('1\n') if sys.version >= "2.6": self.old_base = site.USER_BASE site.USER_BASE = tempfile.mkdtemp() |