migration.py
changeset 10615 6c497fe389d2
parent 10612 84468b90e9c1
child 10662 10942ed172de
--- a/migration.py	Tue Sep 15 15:33:47 2015 +0200
+++ b/migration.py	Fri Sep 18 18:26:07 2015 +0200
@@ -349,7 +349,9 @@
             else:
                 pyname = splitext(basename(migrscript))[0]
             scriptlocals['__name__'] = pyname
-            execfile(migrscript, scriptlocals)
+            with open(migrscript, 'rb') as fobj:
+                code = compile(fobj.read(), migrscript, 'exec')
+            exec(code, scriptlocals)
             if funcname is not None:
                 try:
                     func = scriptlocals[funcname]