Skip to content

Commit 36364be

Browse files
committed
Fix a bug in Rev 1.10 - Windows can't handle a leading ':' if the
user's PYTHONPATH is empty (though Linux can). Modified Files: idle idle.py idle.pyw
1 parent 67fd0ea commit 36364be

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

Lib/idlelib/idle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ except ImportError:
1414
if idledir != os.getcwd():
1515
# We're not in the IDLE directory, help the subprocess find run.py
1616
pypath = os.environ.get('PYTHONPATH', '')
17-
os.environ['PYTHONPATH'] = pypath + ':' + idledir
17+
if pypath:
18+
os.environ['PYTHONPATH'] = pypath + ':' + idledir
19+
else:
20+
os.environ['PYTHONPATH'] = idledir
1821
PyShell.main()
1922
else:
2023
idlelib.PyShell.main()

Lib/idlelib/idle.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
if idledir != os.getcwd():
1515
# We're not in the IDLE directory, help the subprocess find run.py
1616
pypath = os.environ.get('PYTHONPATH', '')
17-
os.environ['PYTHONPATH'] = pypath + ':' + idledir
17+
if pypath:
18+
os.environ['PYTHONPATH'] = pypath + ':' + idledir
19+
else:
20+
os.environ['PYTHONPATH'] = idledir
1821
PyShell.main()
1922
else:
2023
idlelib.PyShell.main()

Lib/idlelib/idle.pyw

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ except ImportError:
1212
if idledir != os.getcwd():
1313
# We're not in the IDLE directory, help the subprocess find run.py
1414
pypath = os.environ.get('PYTHONPATH', '')
15-
os.environ['PYTHONPATH'] = pypath + ':' + idledir
15+
if pypath:
16+
os.environ['PYTHONPATH'] = pypath + ':' + idledir
17+
else:
18+
os.environ['PYTHONPATH'] = idledir
1619
PyShell.main()
1720
else:
1821
idlelib.PyShell.main()

0 commit comments

Comments
 (0)