blob: 767db865a558ce7ce9b2116b4b4615492fb7911e [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:
Kurt B. Kaisera80d57c2003-05-17 03:15:48 +00005 try:
6 import PyShell
7 except ImportError:
Kurt B. Kaiserc6266582003-05-19 02:07:44 +00008 raise
Kurt B. Kaisera80d57c2003-05-17 03:15:48 +00009 else:
10 import os
11 idledir = os.path.dirname(os.path.abspath(PyShell.__file__))
12 if idledir != os.getcwd():
13 # We're not in the IDLE directory, help the subprocess find run.py
14 pypath = os.environ.get('PYTHONPATH', '')
15 os.environ['PYTHONPATH'] = pypath + ':' + idledir
16 PyShell.main()
Kurt B. Kaisere23ca3c2003-01-02 17:09:34 +000017else:
18 idlelib.PyShell.main()