Commit 6047b1fe authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Use tuple style of exec to make archive 2/3 compatible

Change *.iteritems() to list(*.items())
parent 4acef0cb
...@@ -163,10 +163,7 @@ class Importer: ...@@ -163,10 +163,7 @@ class Importer:
BAD = None BAD = None
try: try:
code = compile(src, "%s/%s" % (self.path, filename), 'exec') code = compile(src, "%s/%s" % (self.path, filename), 'exec')
if sys.version_info < (3,): exec(code, mod.__dict__)
exec("exec code in mod.__dict__")
else:
exec(code, mod.__dict__)
except SystemExit as e: except SystemExit as e:
# Silently propagate exit # Silently propagate exit
raise e raise e
...@@ -197,7 +194,7 @@ def extract(dest='.'): ...@@ -197,7 +194,7 @@ def extract(dest='.'):
\"\"\"Extracts archived files in dest directory ('.' is default)\"\"\" \"\"\"Extracts archived files in dest directory ('.' is default)\"\"\"
import os import os
import os.path import os.path
for (m, (f, c)) in code.iteritems(): for (m, (f, c)) in list(code.items()):
filepath = '%s/%s' % (dest, f) filepath = '%s/%s' % (dest, f)
dirpath = os.path.dirname(filepath) dirpath = os.path.dirname(filepath)
if os.path.exists(filepath): if os.path.exists(filepath):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment