Skip to content

Commit b63c4fc

Browse files
committedSep 30, 2016
Issue python#25488: merge idle.py from 3.5.
2 parents c6b5f08 + 1813aa1 commit b63c4fc

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed
 

‎Lib/idlelib/idle.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import os.path
22
import sys
33

4-
# If we are working on a development version of IDLE, we need to prepend the
5-
# parent of this idlelib dir to sys.path. Otherwise, importing idlelib gets
6-
# the version installed with the Python used to call this module:
4+
5+
# Enable running IDLE with idlelib in a non-standard location.
6+
# This was once used to run development versions of IDLE.
7+
# Because PEP 434 declared idle.py a public interface,
8+
# removal should require deprecation.
79
idlelib_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
8-
sys.path.insert(0, idlelib_dir)
10+
if idlelib_dir not in sys.path:
11+
sys.path.insert(0, idlelib_dir)
912

10-
import idlelib.pyshell
11-
idlelib.pyshell.main()
13+
from idlelib.pyshell import main # This is subject to change
14+
main()

0 commit comments

Comments
 (0)