summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Holth <dholth@fastmail.fm>2013-08-22 14:12:45 -0400
committerDaniel Holth <dholth@fastmail.fm>2013-08-22 14:12:45 -0400
commit85f15d4ff7766eba3b26d559478adf97455aac7a (patch)
tree100a8fcf0dc9561fe3ae207268c08c0315e67bed
parente85d57bdade313792aaa18114f736f296b5b7442 (diff)
parentafdf4159a5c94088424f613512fed0181e855235 (diff)
downloadwheel-85f15d4ff7766eba3b26d559478adf97455aac7a.tar.gz
Merged in poirier/wheel (pull request #25)
Add a version command
-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)