From 4a2e1a0da7f1f16ee6a9ce75fdd60b4d30cb37d1 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 8 Feb 2012 19:11:53 -0500 Subject: Undo a bad mq management thingy. --- Lib/importlib/_bootstrap.py | 44 -------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index 431b6dd..9f7bd11 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -1038,47 +1038,3 @@ def _setup(sys_module, imp_module): raise ImportError('importlib requires posix or nt') setattr(self_module, '_os', os_module) setattr(self_module, 'path_sep', path_sep) - - - -def _setup(sys_module, imp_module): - """Setup importlib by importing needed built-in modules and injecting them - into the global namespace. - - As sys is needed for sys.modules access and imp is needed to load built-in - modules those two modules must be explicitly passed in. - - """ - global imp, sys - imp = imp_module - sys = sys_module - - for module in (imp, sys): - if not hasattr(module, '__loader__'): - module.__loader__ = BuiltinImporter - - self_module = sys.modules[__name__] - for builtin_name in ('_io', '_warnings', 'builtins', 'marshal'): - if builtin_name not in sys.modules: - builtin_module = BuiltinImporter.load_module(builtin_name) - else: - builtin_module = sys.modules[builtin_name] - setattr(self_module, builtin_name, builtin_module) - - for builtin_os, path_sep in [('posix', '/'), ('nt', '\\'), ('os2', '\\')]: - if builtin_os in sys.modules: - os_module = sys.modules[builtin_os] - break - else: - try: - os_module = BuiltinImporter.load_module(builtin_os) - # TODO: rip out os2 code after 3.3 is released as per PEP 11 - if builtin_os == 'os2' and 'EMX GCC' in sys.version: - path_sep = '/' - break - except ImportError: - continue - else: - raise ImportError('importlib requires posix or nt') - setattr(self_module, '_os', os_module) - setattr(self_module, 'path_sep', path_sep) -- cgit v0.12