2002-12-24 02:36:19 -04:00
|
|
|
try:
|
2016-05-28 14:22:31 -03:00
|
|
|
import idlelib.pyshell
|
2002-12-31 19:18:00 -04:00
|
|
|
except ImportError:
|
2016-05-28 14:22:31 -03:00
|
|
|
# IDLE is not installed, but maybe pyshell is on sys.path:
|
|
|
|
from . import pyshell
|
2015-05-20 10:15:02 -03:00
|
|
|
import os
|
2016-05-28 14:22:31 -03:00
|
|
|
idledir = os.path.dirname(os.path.abspath(pyshell.__file__))
|
2015-05-20 10:15:02 -03:00
|
|
|
if idledir != os.getcwd():
|
|
|
|
# We're not in the IDLE directory, help the subprocess find run.py
|
|
|
|
pypath = os.environ.get('PYTHONPATH', '')
|
|
|
|
if pypath:
|
|
|
|
os.environ['PYTHONPATH'] = pypath + ':' + idledir
|
|
|
|
else:
|
|
|
|
os.environ['PYTHONPATH'] = idledir
|
2016-05-28 14:22:31 -03:00
|
|
|
pyshell.main()
|
2003-01-02 13:09:34 -04:00
|
|
|
else:
|
2016-05-28 14:22:31 -03:00
|
|
|
idlelib.pyshell.main()
|