Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Commit

Permalink
Fix issue with running on python 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
drennalls committed Nov 6, 2013
1 parent 9d06f66 commit c5bbbfc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions superzippy/bootstrapper/zipsite.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import site as _site
from site import *


from contextlib import closing
import zipfile
import os
import traceback
Expand Down Expand Up @@ -112,7 +114,7 @@ def exists(path):
return os.path.exists(path)

# otherwise check the zip file.
with zipfile.ZipFile(archive_path, mode = "r") as archive:
with closing(zipfile.ZipFile(archive_path, mode = "r")) as archive:
try:
archive.getinfo(file_path)
except KeyError:
Expand Down Expand Up @@ -145,7 +147,7 @@ def addsitedir(sitedir, known_paths = None, prepend_mode = False):
else:
sys.path.append(sitedir)

with zipfile.ZipFile(archive_path, mode = "r") as archive:
with closing(zipfile.ZipFile(archive_path, mode = "r")) as archive:
# Go trhough everything in the archive...
for i in archive.infolist():
# and grab all the .pth files.
Expand Down

0 comments on commit c5bbbfc

Please sign in to comment.