summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Stewart <4b796c65+bitbucket@gmail.com>2016-03-17 06:10:31 -0700
committerKyle Stewart <4b796c65+bitbucket@gmail.com>2016-03-17 06:10:31 -0700
commit00e5569e02c60b083f4f6c6a887b41a775f79423 (patch)
tree16133118e1e9ae8ba19927bcf922e74943673ba2
parentf9508d6b662f9d35ca44d3c781947206e0e6c5c0 (diff)
downloadwheel-00e5569e02c60b083f4f6c6a887b41a775f79423.tar.gz
use context manager when reading package info
-rw-r--r--wheel/metadata.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/wheel/metadata.py b/wheel/metadata.py
index d037c3a..47b15ce 100644
--- a/wheel/metadata.py
+++ b/wheel/metadata.py
@@ -111,7 +111,8 @@ def pkginfo_to_dict(path, distribution=None):
unicode
pkg_info = read_pkg_info(path)
except NameError:
- pkg_info = email.parser.Parser().parsestr(open(path, 'rb').read().decode('utf-8'))
+ with open(path, 'rb') as pkg_info_file:
+ pkg_info = email.parser.Parser().parsestr(pkg_info_file.read().decode('utf-8'))
description = None
if pkg_info['Summary']: