diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-30 10:39:12 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-30 10:39:12 +0300 |
commit | bf39849e568dcffc49700ae2addc0fc3ca99eaeb (patch) | |
tree | 82667af1bc6c5b419bc4c7a3a84d76cb4a379620 | |
parent | be9cddb302e51d6a3b8f5217f6d8628e842538b7 (diff) | |
parent | 41a580045631c9b5f325d2c57a2a1c1926653051 (diff) | |
download | cpython-git-bf39849e568dcffc49700ae2addc0fc3ca99eaeb.tar.gz |
Merge heads
-rw-r--r-- | Lib/idlelib/idle.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Lib/idlelib/idle.py b/Lib/idlelib/idle.py index c01cf992cc..485d5a75a2 100644 --- a/Lib/idlelib/idle.py +++ b/Lib/idlelib/idle.py @@ -1,11 +1,14 @@ import os.path import sys -# If we are working on a development version of IDLE, we need to prepend the -# parent of this idlelib dir to sys.path. Otherwise, importing idlelib gets -# the version installed with the Python used to call this module: + +# Enable running IDLE with idlelib in a non-standard location. +# This was once used to run development versions of IDLE. +# Because PEP 434 declared idle.py a public interface, +# removal should require deprecation. idlelib_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -sys.path.insert(0, idlelib_dir) +if idlelib_dir not in sys.path: + sys.path.insert(0, idlelib_dir) -import idlelib.pyshell -idlelib.pyshell.main() +from idlelib.pyshell import main # This is subject to change +main() |