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