diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-05-17 23:21:19 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-05-17 23:21:19 -0400 |
commit | 7c471a14c008d879b0877c15f0fd2079f580a1e1 (patch) | |
tree | 103d292bb3fcf547e4f9a8ad0b6638edd1fb67b2 /setuptools/compat.py | |
parent | 0f7f8d71dc1c8eda869c423a324064d4bc419879 (diff) | |
download | external_python_setuptools-7c471a14c008d879b0877c15f0fd2079f580a1e1.tar.gz external_python_setuptools-7c471a14c008d879b0877c15f0fd2079f580a1e1.tar.bz2 external_python_setuptools-7c471a14c008d879b0877c15f0fd2079f580a1e1.zip |
Use context manager for brevity
Diffstat (limited to 'setuptools/compat.py')
-rw-r--r-- | setuptools/compat.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/setuptools/compat.py b/setuptools/compat.py index 7397d7fa..09e5af5c 100644 --- a/setuptools/compat.py +++ b/setuptools/compat.py @@ -70,11 +70,8 @@ if PY3: globs = globals() if locs is None: locs = globs - f = open(fn, 'rb') - try: + with open(fn, 'rb') as f: source = f.read() - finally: - f.close() exec(compile(source, fn, 'exec'), globs, locs) def reraise(tp, value, tb=None): |