summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/ScriptBinding.py
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2003-05-15 23:23:21 (GMT)
committerKurt B. Kaiser <kbk@shore.net>2003-05-15 23:23:21 (GMT)
commit11659ade1e63095ac6217b4e190c14b494ddcf82 (patch)
treec7aa7368e5dd7f2b2e7971f8cb35d0df550e59ca /Lib/idlelib/ScriptBinding.py
parent8f570a768fcefef5e8c9f9cf1facc4f8cdc3ef3f (diff)
downloadcpython-11659ade1e63095ac6217b4e190c14b494ddcf82.zip
cpython-11659ade1e63095ac6217b4e190c14b494ddcf82.tar.gz
cpython-11659ade1e63095ac6217b4e190c14b494ddcf82.tar.bz2
1. When a module is run from an EditorWindow, if its directory is not in
sys.path, prepend it. This allows the module to import other modules in the same directory. Do the same for a script run from the command line. 2. Tweak the IDLE usage message a bit more. SF Bug 706860 (closed) SF Patch 686254 (reject specific solution) SF Patch 507327 (similar) M PyShell.py M ScriptBinding.py
Diffstat (limited to 'Lib/idlelib/ScriptBinding.py')
-rw-r--r--Lib/idlelib/ScriptBinding.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/idlelib/ScriptBinding.py b/Lib/idlelib/ScriptBinding.py
index d404fc9..252526d 100644
--- a/Lib/idlelib/ScriptBinding.py
+++ b/Lib/idlelib/ScriptBinding.py
@@ -144,8 +144,9 @@ class ScriptBinding:
if (not _sys.argv or
_basename(_sys.argv[0]) != _basename(_filename)):
_sys.argv = [_filename]
- del _filename, _sys, _basename
- \n""" % `filename`)
+ del _filename, _sys, _basename
+ \n""" % `filename`)
+ interp.prepend_syspath(filename)
interp.runcode(code)
def getfilename(self):