]> granicus.if.org Git - python/commitdiff
SF patch 661583: Remove old code from lib\os.py
authorTim Peters <tim.peters@gmail.com>
Wed, 8 Jan 2003 21:20:57 +0000 (21:20 +0000)
committerTim Peters <tim.peters@gmail.com>
Wed, 8 Jan 2003 21:20:57 +0000 (21:20 +0000)
A patch from Andrew Wilkinson to change some bizarre old exec statements
specific to NT and CE.

Lib/os.py

index 4876539b4da520aaa9a0a54587d63cf6c793c9fa..5d6bc64b410b34fb44a99a2ee80cb6e7fdb31773 100644 (file)
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -61,11 +61,10 @@ elif 'nt' in _names:
     curdir = '.'; pardir = '..'; sep = '\\'; pathsep = ';'
     defpath = '.;C:\\bin'
     from nt import *
-    for i in ['_exit']:
-        try:
-            exec "from nt import " + i
-        except ImportError:
-            pass
+    try:
+        from nt import _exit
+    except ImportError:
+        pass
     import ntpath
     path = ntpath
     del ntpath
@@ -127,11 +126,10 @@ elif 'ce' in _names:
     curdir = '.'; pardir = '..'; sep = '\\'; pathsep = ';'
     defpath = '\\Windows'
     from ce import *
-    for i in ['_exit']:
-        try:
-            exec "from ce import " + i
-        except ImportError:
-            pass
+    try:
+        from ce import _exit
+    except ImportError:
+        pass
     # We can use the standard Windows path.
     import ntpath
     path = ntpath