blob: 00a1fe3a00d121300c1e1150427ca629e2d54c5e [file] [log] [blame]
Kurt B. Kaiser7cca3d82002-12-31 23:18:00 +00001#!/usr/bin/python
David Scherer7aced172000-08-15 01:13:23 +00002
Kurt B. Kaiserf4f42762002-12-24 06:36:19 +00003try:
4 import idlelib.PyShell
Kurt B. Kaiser7cca3d82002-12-31 23:18:00 +00005except ImportError:
Kurt B. Kaiserf4f42762002-12-24 06:36:19 +00006 # IDLE is not installed, but maybe PyShell is on sys.path:
Kurt B. Kaisera80d57c2003-05-17 03:15:48 +00007 try:
8 import PyShell
9 except ImportError:
Kurt B. Kaiserc6266582003-05-19 02:07:44 +000010 raise
Kurt B. Kaisera80d57c2003-05-17 03:15:48 +000011 else:
12 import os
13 idledir = os.path.dirname(os.path.abspath(PyShell.__file__))
14 if idledir != os.getcwd():
15 # We're not in the IDLE directory, help the subprocess find run.py
16 pypath = os.environ.get('PYTHONPATH', '')
Kurt B. Kaiser36364be2003-05-24 21:01:39 +000017 if pypath:
18 os.environ['PYTHONPATH'] = pypath + ':' + idledir
19 else:
20 os.environ['PYTHONPATH'] = idledir
Kurt B. Kaisera80d57c2003-05-17 03:15:48 +000021 PyShell.main()
Kurt B. Kaisere23ca3c2003-01-02 17:09:34 +000022else:
23 idlelib.PyShell.main()