summaryrefslogtreecommitdiffstats
path: root/Tools/idle/ScriptBinding.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/idle/ScriptBinding.py')
-rw-r--r--Tools/idle/ScriptBinding.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Tools/idle/ScriptBinding.py b/Tools/idle/ScriptBinding.py
index 94a248f..9af8236 100644
--- a/Tools/idle/ScriptBinding.py
+++ b/Tools/idle/ScriptBinding.py
@@ -73,6 +73,9 @@ class ScriptBinding:
flist = self.editwin.flist
shell = flist.open_shell()
interp = shell.interp
+ if (not sys.argv or
+ os.path.basename(sys.argv[0]) != os.path.basename(filename)):
+ sys.argv = [filename]
interp.execfile(filename)
def getfilename(self):