commit | ee03611a8dd6ccb4ae408fbe2e43afda9d2da316 | [log] [tgz] |
---|---|---|
author | Guido van Rossum <guido@python.org> | Tue Jun 01 18:18:27 1999 +0000 |
committer | Guido van Rossum <guido@python.org> | Tue Jun 01 18:18:27 1999 +0000 |
tree | 319691f80e36dc689d676f7a26cca9ba1ac6c35e | |
parent | 96cf271be9c7046eececc31aac5d65bc904a554d [diff] |
Ensure sys.argv[0] is the script name on Run Script.
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 @@ 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):