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

This commit is contained in:
Guido van Rossum 1999-02-01 23:06:17 +00:00
parent a6dff3e772
commit 8e47306b99
1 changed files with 7 additions and 0 deletions

View File

@ -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()