]> granicus.if.org Git - python/commitdiff
Remove dead PEP 451 code.
authorEric Snow <ericsnowcurrently@gmail.com>
Tue, 7 Jan 2014 03:38:16 +0000 (20:38 -0700)
committerEric Snow <ericsnowcurrently@gmail.com>
Tue, 7 Jan 2014 03:38:16 +0000 (20:38 -0700)
Lib/importlib/_bootstrap.py
Lib/test/test_importlib/test_spec.py

index 864e546d5c544f2e1cd3b5d331e9e9406348e09b..98ecc6673efe0ab60ae2ab4448b2743bae24293f 100644 (file)
@@ -1183,15 +1183,6 @@ class _SpecMethods:
                 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 @@ class WindowsRegistryFinder:
 
     @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
index 2af47f4b993f5d9f9ded9aadab1541cfc06145c5..ae77a28665e1b6f72b7d1029c2cd8de34e7d48ab 100644 (file)
@@ -437,18 +437,6 @@ class ModuleSpecMethodsTests:
                 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):