[Python-checkins] r56658 - sandbox/trunk/import_in_py/importlib.py
brett.cannon
python-checkins at python.org
Thu Aug 2 05:22:20 CEST 2007
Author: brett.cannon
Date: Thu Aug 2 05:22:19 2007
New Revision: 56658
Modified:
sandbox/trunk/import_in_py/importlib.py
Log:
Reorganize stuff to make it more clear what is left to be done.
Modified: sandbox/trunk/import_in_py/importlib.py
==============================================================================
--- sandbox/trunk/import_in_py/importlib.py (original)
+++ sandbox/trunk/import_in_py/importlib.py Thu Aug 2 05:22:19 2007
@@ -100,10 +100,6 @@
# Required built-in modules.
-import imp, sys, marshal
-_importlib.imp = imp
-_importlib.sys = sys
-_importlib.marshal = marshal
try:
import posix as _os
except ImportError:
@@ -113,8 +109,13 @@
try:
import os2 as _os
except ImportError:
- raise ImportError('posix, nt, or os2 required for importlib')
+ raise ImportError('posix, nt, or os2 module required for importlib')
_importlib._os = _os
+import imp, sys, marshal
+_importlib.imp = imp
+_importlib.sys = sys
+_importlib.marshal = marshal
+
# XXX These all need to either go away or become built-in modules
# (<cough>Neal</cough>).
@@ -125,7 +126,8 @@
_importlib._r_long = _r_long #XXX Expose original from marshal.
_importlib._w_long = _w_long #XXX Expose original from marshal.
_importlib._case_ok = _case_ok #XXX Expose original from imp.
-_importlib.path_sep = sep # For os.path.join replacement.
+# For os.path.join replacement; pull from Include/osdefs.h:SEP .
+_importlib.path_sep = sep
# For allowing silent failure of .pyc creation when permission is denied.
_importlib.EACCES = EACCES
More information about the Python-checkins
mailing list