Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/idlelib/idle.py

    r2 r391  
    1 try:
    2     import idlelib.PyShell
    3 except ImportError:
    4     # IDLE is not installed, but maybe PyShell is on sys.path:
    5     try:
    6         import PyShell
    7     except ImportError:
    8         raise
    9     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             if pypath:
    16                 os.environ['PYTHONPATH'] = pypath + ':' + idledir
    17             else:
    18                 os.environ['PYTHONPATH'] = idledir
    19         PyShell.main()
    20 else:
    21     idlelib.PyShell.main()
     1import os.path
     2import sys
     3
     4# If we are working on a development version of IDLE, we need to prepend the
     5# parent of this idlelib dir to sys.path.  Otherwise, importing idlelib gets
     6# the version installed with the Python used to call this module:
     7idlelib_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
     8sys.path.insert(0, idlelib_dir)
     9
     10import idlelib.PyShell
     11idlelib.PyShell.main()
Note: See TracChangeset for help on using the changeset viewer.