From 4e2823bc3f2f5505ee15fc72ebcc287e5061199d Mon Sep 17 00:00:00 2001 From: Philip Thiem Date: Sat, 16 Feb 2013 10:46:33 -0600 Subject: Seems to be an issue with using ZipFile as a context on python 3.1 --HG-- branch : distribute extra : rebase_source : d81c62a1c2efbeefc848979e07b16506213c0949 --- pkg_resources.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3