summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wheel/bdist_wheel.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/wheel/bdist_wheel.py b/wheel/bdist_wheel.py
index db6e338..77d1752 100644
--- a/wheel/bdist_wheel.py
+++ b/wheel/bdist_wheel.py
@@ -432,7 +432,8 @@ class bdist_wheel(Command):
hash = ''
size = ''
else:
- data = open(path, 'rb').read()
+ with open(path, 'rb') as f:
+ data = f.read()
digest = hashlib.sha256(data).digest()
hash = 'sha256=' + native(urlsafe_b64encode(digest))
size = len(data)