Kaydet (Commit) 8e47306b authored tarafından Guido van Rossum's avatar Guido van Rossum

Add current dir or paths of file args to sys.path.

üst a6dff3e7
...@@ -612,6 +612,13 @@ def main(): ...@@ -612,6 +612,13 @@ def main():
if args: if args:
for filename in sys.argv[1:]: for filename in sys.argv[1:]:
flist.open(filename) flist.open(filename)
aPath = os.path.abspath(os.path.dirname(filename))
if not aPath in sys.path:
sys.path.insert(0, aPath)
else:
aPath = os.getcwd()
if not aPath in sys.path:
sys.path.insert(0, aPath)
t = PyShell(flist) t = PyShell(flist)
flist.pyshell = t flist.pyshell = t
t.begin() t.begin()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment