--- 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]
--- a/web/propertysheet.py Tue Sep 15 15:33:47 2015 +0200
+++ b/web/propertysheet.py Fri Sep 18 18:26:07 2015 +0200
@@ -57,7 +57,9 @@
def load(self, fpath):
scriptglobals = self.context.copy()
scriptglobals['__file__'] = fpath
- execfile(fpath, scriptglobals, self)
+ with open(fpath, 'rb') as fobj:
+ code = compile(fobj.read(), fpath, 'exec')
+ exec(code, scriptglobals, self)
for name, type in TYPE_CHECKS:
if name in self:
if not isinstance(self[name], type):