diff options
author | Kyle Stewart <4b796c65+bitbucket@gmail.com> | 2016-03-17 05:25:28 -0700 |
---|---|---|
committer | Kyle Stewart <4b796c65+bitbucket@gmail.com> | 2016-03-17 05:25:28 -0700 |
commit | e992a5bb8ed77fe6f9e46da1e2add3c5f12038f8 (patch) | |
tree | c7ad274fb86241e586b6f7a8f7f5f801a23caeaa | |
parent | 80a06d58f7e5fbf2cc54ec3dbc3f90f188d58bcb (diff) | |
download | wheel-e992a5bb8ed77fe6f9e46da1e2add3c5f12038f8.tar.gz |
use context manager when reading requires.txt
-rw-r--r-- | wheel/metadata.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wheel/metadata.py b/wheel/metadata.py index b3cc65c..d037c3a 100644 --- a/wheel/metadata.py +++ b/wheel/metadata.py @@ -244,7 +244,8 @@ def pkginfo_to_metadata(egg_info_path, pkginfo_path): pkg_info.replace_header('Metadata-Version', '2.0') requires_path = os.path.join(egg_info_path, 'requires.txt') if os.path.exists(requires_path): - requires = open(requires_path).read() + with open(requires_path) as requires_file: + requires = requires_file.read() for extra, reqs in sorted(pkg_resources.split_sections(requires), key=lambda x: x[0] or ''): condition = '' |