From d694c1faf9314c9c531db59d24f90223cf720583 Mon Sep 17 00:00:00 2001 From: "Kurt B. Kaiser" Date: Sun, 28 Jul 2002 03:35:31 +0000 Subject: Reset the Python execution server environment to its initial value prior to executing Run/F5 from an EditorWindow. M ScriptBinding.py : add call to clear_the_environment() M run.py : implemented Executive.clear_the_environment() --- Lib/idlelib/ScriptBinding.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Lib/idlelib/ScriptBinding.py') diff --git a/Lib/idlelib/ScriptBinding.py b/Lib/idlelib/ScriptBinding.py index 68f9cd7d95..6d4c652c5e 100644 --- a/Lib/idlelib/ScriptBinding.py +++ b/Lib/idlelib/ScriptBinding.py @@ -144,10 +144,11 @@ class ScriptBinding: filename = self.getfilename() if not filename: return - flist = self.editwin.flist shell = flist.open_shell() interp = shell.interp + # clear the subprocess environment before every Run/F5 invocation + interp.rpcclt.remotecall("exec", "clear_the_environment", (), {}) # XXX Too often this discards arguments the user just set... interp.runcommand("""if 1: _filename = %s @@ -155,6 +156,7 @@ class ScriptBinding: from os.path import basename as _basename if (not _sys.argv or _basename(_sys.argv[0]) != _basename(_filename)): + # XXX 25 July 2002 KBK should this be sys.argv not _sys.argv? _sys.argv = [_filename] del _filename, _sys, _basename \n""" % `filename`) -- cgit v1.2.1