diff options
author | Brett Cannon <brett@python.org> | 2012-02-08 23:50:22 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2012-02-08 23:50:22 (GMT) |
commit | 354c26ecd6d1f6341bb1f65ea099d6952a29abd8 (patch) | |
tree | 3e5ca9ca9e590d5b8e0455200b3338740aedf1ee /Lib/importlib/__init__.py | |
parent | 8490fab4add07e4db261053fb420c2e411f82026 (diff) | |
download | cpython-354c26ecd6d1f6341bb1f65ea099d6952a29abd8.zip cpython-354c26ecd6d1f6341bb1f65ea099d6952a29abd8.tar.gz cpython-354c26ecd6d1f6341bb1f65ea099d6952a29abd8.tar.bz2 |
Move setup code from importlib.__init__ to
importlib._bootstrap._setup().
Diffstat (limited to 'Lib/importlib/__init__.py')
-rw-r--r-- | Lib/importlib/__init__.py | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/Lib/importlib/__init__.py b/Lib/importlib/__init__.py index ec6a965..940a9a2 100644 --- a/Lib/importlib/__init__.py +++ b/Lib/importlib/__init__.py @@ -22,9 +22,6 @@ __all__ = ['__import__', 'import_module'] from . import _bootstrap -import os -import re -import tokenize # To simplify imports in test code _w_long = _bootstrap._w_long @@ -32,31 +29,10 @@ _r_long = _bootstrap._r_long # Bootstrap help ##################################################### +import imp +import sys -# Required built-in modules. -try: - import posix as _os -except ImportError: - try: - import nt as _os - except ImportError: - try: - import os2 as _os - except ImportError: - raise ImportError('posix, nt, or os2 module required for importlib') -_bootstrap._os = _os -import imp, sys, marshal, _io -_bootstrap.imp = imp -_bootstrap.sys = sys -_bootstrap.marshal = marshal -_bootstrap._io = _io -import _warnings -_bootstrap._warnings = _warnings - - -from os import sep -# For os.path.join replacement; pull from Include/osdefs.h:SEP . -_bootstrap.path_sep = sep +_bootstrap._setup(sys, imp) # Public API ######################################################### |