summaryrefslogtreecommitdiff
path: root/Tools/idle/PyShell.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-02-01 23:06:17 +0000
committerGuido van Rossum <guido@python.org>1999-02-01 23:06:17 +0000
commit8e47306b993ccc9745cf8e21e1d008e6ee8e7a16 (patch)
tree80be070ddaa76d90ef25acc4f62e6b5de44ce35e /Tools/idle/PyShell.py
parenta6dff3e77287bbb08e8c3700b789a50485cf630d (diff)
downloadcpython-git-8e47306b993ccc9745cf8e21e1d008e6ee8e7a16.tar.gz
Add current dir or paths of file args to sys.path.
Diffstat (limited to 'Tools/idle/PyShell.py')
-rw-r--r--Tools/idle/PyShell.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py
index 115d96f8f9..e197ad6237 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()