summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/idle
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2002-12-21 21:03:06 (GMT)
committerKurt B. Kaiser <kbk@shore.net>2002-12-21 21:03:06 (GMT)
commitdd70e1be91dcf4d20150f11cc0262c9e623b1fae (patch)
tree8aa283341bda49e2953e10629c5f8406586e2297 /Lib/idlelib/idle
parent9c36c29156bf7d6f2349a2ca577771dd68fe63a9 (diff)
downloadcpython-dd70e1be91dcf4d20150f11cc0262c9e623b1fae.zip
cpython-dd70e1be91dcf4d20150f11cc0262c9e623b1fae.tar.gz
cpython-dd70e1be91dcf4d20150f11cc0262c9e623b1fae.tar.bz2
M PyShell.py
M idle M setup.py To be able to run from the source directory or from an installed version of IDLE, and also to allow the subprocess to find run(), Python needs to have the idlelib package on its path. 1. Modify setup.py to supply a .pth file living at same level as idlelib 2. Move boolcheck to PyShell.py 3. Remove boolcheck and path setting code from the "idle" script
Diffstat (limited to 'Lib/idlelib/idle')
-rwxr-xr-xLib/idlelib/idle30
1 files changed, 7 insertions, 23 deletions
diff --git a/Lib/idlelib/idle b/Lib/idlelib/idle
index d5aab04..08af399 100755
--- a/Lib/idlelib/idle
+++ b/Lib/idlelib/idle
@@ -1,33 +1,17 @@
#! /usr/bin/env python
-# Add IDLE.app/Contents/Resources/idlelib to path.
-# __file__ refers to this file when it is used as a module, sys.argv[0]
-# refers to this file when it is used as a script (pythonw macosx_main.py)
-import sys
-from os.path import split, join
-try:
- __file__
-except NameError:
- __file__ = sys.argv[0]
-idlelib = join(split(__file__)[0], 'idlelib')
-if os.path.isdir(idlelib):
- sys.path.append(idlelib)
+import sys as _sys
-# Make sure True, False, bool() builtins exist.
-# - preserves 2.2 compatibility - 2.2.1 includes bool, 2.2 does not.
-# - important for Mac OS X because it ships python 2.2
-import boolcheck
-
-# see if we are being asked to execute the subprocess code
-if '-p' in sys.argv:
- # run expects only the port number in sys.argv
- sys.argv.remove('-p')
+# See if we are being asked to execute the subprocess code
+if '-p' in _sys.argv:
+ # run expects only the port number in _sys.argv
+ _sys.argv.remove('-p')
# this module will become the namepsace used by the interactive
# interpreter; remove all variables we have defined.
- del sys, __file__, boolcheck, split, join
+ del _sys
__import__('run').main()
else:
- # start the application.
+ # Start the IDLE GUI
import PyShell
PyShell.main()