From: Guido van Rossum Date: Mon, 1 Feb 1999 23:06:17 +0000 (+0000) Subject: Add current dir or paths of file args to sys.path. X-Git-Tag: v1.5.2b2~161 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e47306b993ccc9745cf8e21e1d008e6ee8e7a16;p=thirdparty%2FPython%2Fcpython.git Add current dir or paths of file args to sys.path. --- diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py index 115d96f8f991..e197ad623745 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()