mirror of
https://github.com/cemu-project/idapython.git
synced 2024-11-28 03:54:18 +01:00
init.py: __file__ path is properly set for scripts run with Alt-9
This commit is contained in:
parent
b0d8723ccb
commit
9876c4ffa7
@ -59,8 +59,17 @@ def runscript(script):
|
||||
watchdog.reset()
|
||||
argv = sys.argv
|
||||
sys.argv = [ script ]
|
||||
execfile(script, globals())
|
||||
sys.argv = argv
|
||||
# Adjust the __file__ path in the globals we pass to the script
|
||||
g = globals()
|
||||
old__file__ = g['__file__']
|
||||
g['__file__'] = script
|
||||
try:
|
||||
execfile(script, g)
|
||||
except:
|
||||
raise
|
||||
finally:
|
||||
g['__file__'] = old__file__
|
||||
|
||||
|
||||
def print_banner():
|
||||
version1 = "Python interpreter version %d.%d.%d %s (serial %d)" % sys.version_info
|
||||
|
Loading…
Reference in New Issue
Block a user