summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 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()