##// END OF EJS Templates
don't override execfile on Python 2
MinRK -
Show More
@@ -47,6 +47,10 b' if sys.version_info[0] >= 3:'
47 47
48 48 MethodType = types.MethodType
49 49
50 def execfile(fname, glob, loc=None):
51 loc = loc if (loc is not None) else glob
52 exec compile(open(fname).read(), fname, 'exec') in glob, loc
53
50 54 else:
51 55 PY3 = False
52 56
@@ -90,6 +94,6 b' else:'
90 94 def MethodType(func, instance):
91 95 return types.MethodType(func, instance, type(instance))
92 96
93 def execfile(fname, glob, loc=None):
94 loc = loc if (loc is not None) else glob
95 exec compile(open(fname).read(), fname, 'exec') in glob, loc
97 # don't override system execfile on 2.x:
98 execfile = execfile
99
General Comments 0
You need to be logged in to leave comments. Login now