Commit 3192eac6 authored by Eric Snow's avatar Eric Snow

Remove dead PEP 451 code.

parent 3845521b
...@@ -1183,15 +1183,6 @@ class _SpecMethods: ...@@ -1183,15 +1183,6 @@ class _SpecMethods:
pass pass
return module 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): def _load_unlocked(self):
# A helper for direct use by the import system. # A helper for direct use by the import system.
if self.spec.loader is not None: if self.spec.loader is not None:
...@@ -1389,7 +1380,6 @@ class WindowsRegistryFinder: ...@@ -1389,7 +1380,6 @@ class WindowsRegistryFinder:
@classmethod @classmethod
def find_spec(cls, fullname, path=None, target=None): 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) filepath = cls._search_registry(fullname)
if filepath is None: if filepath is None:
return None return None
......
...@@ -437,18 +437,6 @@ class ModuleSpecMethodsTests: ...@@ -437,18 +437,6 @@ class ModuleSpecMethodsTests:
loaded = self.bootstrap._SpecMethods(self.spec).load() loaded = self.bootstrap._SpecMethods(self.spec).load()
self.assertNotIn(self.spec.name, sys.modules) 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): def test_load_legacy(self):
self.spec.loader = LegacyLoader() self.spec.loader = LegacyLoader()
with CleanImport(self.spec.name): with CleanImport(self.spec.name):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment