mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
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
This commit is contained in:
parent
8f570a768f
commit
11659ade1e
2 changed files with 19 additions and 5 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue