Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
837e02328f |
1 changed files with 4 additions and 1 deletions
|
|
@ -55,6 +55,9 @@ def initial_ns():
|
|||
""", ns)
|
||||
return ns
|
||||
|
||||
compile_flags = (__future__.division.compiler_flag
|
||||
| __future__.print_function.compiler_flag)
|
||||
|
||||
def getsource(filename):
|
||||
with open(filename, "rU") as f: return f.read()
|
||||
|
||||
|
|
@ -66,7 +69,7 @@ Returns the resulting top level object"""
|
|||
oldargv = sys.argv[:]
|
||||
try:
|
||||
filename = args[0]
|
||||
code = compile(getsource(filename), filename, 'exec')
|
||||
code = compile(getsource(filename), filename, 'exec', compile_flags)
|
||||
sys.argv[:] = args
|
||||
ns = initial_ns()
|
||||
ns['__file__'] = filename
|
||||
|
|
|
|||
Loading…
Reference in a new issue