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 | e06e37c0555e6906aed5e31069e7ef50e402d416 (patch) | |
| tree | 0f0942b5a807d66e3a77e68ec7c2972b514552ec /setuptools | |
| parent | 7bbf2df38821a1d524b7755637d860ed27f31fc3 (diff) | |
| download | python-setuptools-bitbucket-e06e37c0555e6906aed5e31069e7ef50e402d416.tar.gz | |
Use context manager for brevity
Diffstat (limited to 'setuptools')
| -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): |
