diff options
author | Guido van Rossum <guido@python.org> | 1999-02-01 23:06:17 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-02-01 23:06:17 (GMT) |
commit | 8e47306b993ccc9745cf8e21e1d008e6ee8e7a16 (patch) | |
tree | 80be070ddaa76d90ef25acc4f62e6b5de44ce35e | |
parent | a6dff3e77287bbb08e8c3700b789a50485cf630d (diff) | |
download | cpython-8e47306b993ccc9745cf8e21e1d008e6ee8e7a16.zip cpython-8e47306b993ccc9745cf8e21e1d008e6ee8e7a16.tar.gz cpython-8e47306b993ccc9745cf8e21e1d008e6ee8e7a16.tar.bz2 |
Add current dir or paths of file args to sys.path.
-rw-r--r-- | Tools/idle/PyShell.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py index 115d96f..e197ad6 100644 --- a/Tools/idle/PyShell.py +++ b/Tools/idle/PyShell.py @@ -612,6 +612,13 @@ def main(): if args: for filename in sys.argv[1:]: 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) flist.pyshell = t t.begin() |