##// 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 MethodType = types.MethodType
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 else:
54 else:
51 PY3 = False
55 PY3 = False
52
56
@@ -90,6 +94,6 b' else:'
90 def MethodType(func, instance):
94 def MethodType(func, instance):
91 return types.MethodType(func, instance, type(instance))
95 return types.MethodType(func, instance, type(instance))
92
96
93 def execfile(fname, glob, loc=None):
97 # don't override system execfile on 2.x:
94 loc = loc if (loc is not None) else glob
98 execfile = execfile
95 exec compile(open(fname).read(), fname, 'exec') in glob, loc
99
General Comments 0
You need to be logged in to leave comments. Login now