aboutsummaryrefslogtreecommitdiffstats
path: root/pkg_resources.py
diff options
context:
space:
mode:
authorPhilip Thiem <ptthiem@gmail.com>2013-02-16 10:46:33 -0600
committerPhilip Thiem <ptthiem@gmail.com>2013-02-16 10:46:33 -0600
commit4e2823bc3f2f5505ee15fc72ebcc287e5061199d (patch)
tree4984e2a1f34514c3d73b904d703e1db1c0e643f0 /pkg_resources.py
parent0c10ea7a063c2d3f3c3c539c1d601fd8d95429dd (diff)
downloadexternal_python_setuptools-4e2823bc3f2f5505ee15fc72ebcc287e5061199d.tar.gz
external_python_setuptools-4e2823bc3f2f5505ee15fc72ebcc287e5061199d.tar.bz2
external_python_setuptools-4e2823bc3f2f5505ee15fc72ebcc287e5061199d.zip
Seems to be an issue with using ZipFile as a context on python 3.1
--HG-- branch : distribute extra : rebase_source : d81c62a1c2efbeefc848979e07b16506213c0949
Diffstat (limited to 'pkg_resources.py')
-rw-r--r--pkg_resources.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg_resources.py b/pkg_resources.py
index 144323cb..c29afb56 100644
--- a/pkg_resources.py
+++ b/pkg_resources.py
@@ -1371,11 +1371,15 @@ def build_zipmanifest(path):
* [7] - zipinfo.CRC
"""
zipinfo = dict()
- with zipfile.ZipFile(path) as zfile:
+ zfile = zipfile.ZipFile(path)
+ #Got ZipFile has not __exit__ on python 3.1
+ try:
for zitem in zfile.namelist():
zpath = zitem.replace('/', os.sep)
zipinfo[zpath] = zfile.getinfo(zitem)
assert zipinfo[zpath] is not None
+ finally:
+ zfile.close()
return zipinfo