[Python-checkins] cpython: Remove dead PEP 451 code.
eric.snow
python-checkins at python.org
Tue Jan 7 04:51:08 CET 2014
http://hg.python.org/cpython/rev/2b50ac02a5a8
changeset: 88330:2b50ac02a5a8
user: Eric Snow <ericsnowcurrently at gmail.com>
date: Mon Jan 06 20:38:16 2014 -0700
summary:
Remove dead PEP 451 code.
files:
Lib/importlib/_bootstrap.py | 10 ----------
Lib/test/test_importlib/test_spec.py | 12 ------------
2 files changed, 0 insertions(+), 22 deletions(-)
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -1183,15 +1183,6 @@
pass
return module
- # XXX If we don't end up using this for pythonrun.c/runpy, we should
- # get rid of it.
- def _load_existing(self, module):
- """Exec the spec'ed module into an existing module's namespace."""
- # For use by runpy.
- with _installed_safely(module):
- loaded = self.exec(module)
- return loaded
-
def _load_unlocked(self):
# A helper for direct use by the import system.
if self.spec.loader is not None:
@@ -1389,7 +1380,6 @@
@classmethod
def find_spec(cls, fullname, path=None, target=None):
- # XXX untested! Need a Windows person to write tests (otherwise mock out appropriately)
filepath = cls._search_registry(fullname)
if filepath is None:
return None
diff --git a/Lib/test/test_importlib/test_spec.py b/Lib/test/test_importlib/test_spec.py
--- a/Lib/test/test_importlib/test_spec.py
+++ b/Lib/test/test_importlib/test_spec.py
@@ -437,18 +437,6 @@
loaded = self.bootstrap._SpecMethods(self.spec).load()
self.assertNotIn(self.spec.name, sys.modules)
- def test_load_existing(self):
- existing = type(sys)('ham')
- existing.count = 5
- self.spec.loader = NewLoader()
- with CleanImport(self.name):
- sys.modules[self.name] = existing
- assert self.spec.name == self.name
- loaded = self.bootstrap._SpecMethods(self.spec).load()
-
- self.assertEqual(loaded.eggs, 1)
- self.assertFalse(hasattr(loaded, 'ham'))
-
def test_load_legacy(self):
self.spec.loader = LegacyLoader()
with CleanImport(self.spec.name):
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list