blob: 9ce4c9f8a3363d475f1c6f5d1e3802574ab1ffa9 [file] [log] [blame]
Kurt B. Kaiserf4f42762002-12-24 06:36:19 +00001try:
2 import idlelib.PyShell
Kurt B. Kaiser7cca3d82002-12-31 23:18:00 +00003except ImportError:
Kurt B. Kaiserf4f42762002-12-24 06:36:19 +00004 # IDLE is not installed, but maybe PyShell is on sys.path:
Serhiy Storchakabc504662015-05-20 16:14:54 +03005 import PyShell
6 import os
7 idledir = os.path.dirname(os.path.abspath(PyShell.__file__))
8 if idledir != os.getcwd():
9 # We're not in the IDLE directory, help the subprocess find run.py
10 pypath = os.environ.get('PYTHONPATH', '')
11 if pypath:
12 os.environ['PYTHONPATH'] = pypath + ':' + idledir
13 else:
14 os.environ['PYTHONPATH'] = idledir
15 PyShell.main()
Kurt B. Kaisere23ca3c2003-01-02 17:09:34 +000016else:
17 idlelib.PyShell.main()