From 458120dd40db6b4df55a4e96b650e16798ef06a0 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Tue, 3 May 2011 11:25:13 +0000 Subject: add hg and python --- sys/lib/python/idlelib/idle.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 sys/lib/python/idlelib/idle.py (limited to 'sys/lib/python/idlelib/idle.py') diff --git a/sys/lib/python/idlelib/idle.py b/sys/lib/python/idlelib/idle.py new file mode 100644 index 000000000..537dd5a9a --- /dev/null +++ b/sys/lib/python/idlelib/idle.py @@ -0,0 +1,21 @@ +try: + import idlelib.PyShell +except ImportError: + # IDLE is not installed, but maybe PyShell is on sys.path: + try: + import PyShell + except ImportError: + raise + else: + import os + idledir = os.path.dirname(os.path.abspath(PyShell.__file__)) + if idledir != os.getcwd(): + # We're not in the IDLE directory, help the subprocess find run.py + pypath = os.environ.get('PYTHONPATH', '') + if pypath: + os.environ['PYTHONPATH'] = pypath + ':' + idledir + else: + os.environ['PYTHONPATH'] = idledir + PyShell.main() +else: + idlelib.PyShell.main() -- cgit v1.2.3