[Python-checkins] r52576 - sandbox/trunk/import_in_py/importer.py sandbox/trunk/import_in_py/test_importer.py

brett.cannon python-checkins at python.org
Thu Nov 2 00:12:42 CET 2006


Author: brett.cannon
Date: Thu Nov 2 00:12:42 2006
New Revision: 52576
Modified:
 sandbox/trunk/import_in_py/importer.py
 sandbox/trunk/import_in_py/test_importer.py
Log:
Change the name of the Importer class to Import. This is to disambiguate the
class from actual importer classes.
Modified: sandbox/trunk/import_in_py/importer.py
==============================================================================
--- sandbox/trunk/import_in_py/importer.py	(original)
+++ sandbox/trunk/import_in_py/importer.py	Thu Nov 2 00:12:42 2006
@@ -507,7 +507,7 @@
 return imp.load_dynamic(mod_name, extension_path)
 
 
-class Importer(object):
+class Import(object):
 
 """Class that re-implements __import__.
 
Modified: sandbox/trunk/import_in_py/test_importer.py
==============================================================================
--- sandbox/trunk/import_in_py/test_importer.py	(original)
+++ sandbox/trunk/import_in_py/test_importer.py	Thu Nov 2 00:12:42 2006
@@ -504,7 +504,7 @@
 self.old_path_importer_cache = sys.path_importer_cache.copy()
 sys.path_importer_cache.clear()
 self.default_importer = mock_importer.PassImporter()
- self.importer = importer.Importer(self.default_importer, tuple())
+ self.importer = importer.Import(self.default_importer, tuple())
 
 def tearDown(self):
 """Restore backup of import-related attributes in 'sys'."""
@@ -525,7 +525,7 @@
 
 class ImporterMiscTests(ImporterHelper):
 
- """Test miscellaneous parts of the Importer class.
+ """Test miscellaneous parts of the Import class.
 
 Tests of the default values for __init__ are handled in the integration
 tests.
@@ -577,7 +577,7 @@
 pass_importer = mock_importer.PassImporter()
 sys.meta_path = [pass_importer]
 succeed_importer = mock_importer.SucceedImporter()
- importer_ = importer.Importer(extended_meta_path=(succeed_importer,))
+ importer_ = importer.Import(extended_meta_path=(succeed_importer,))
 module = importer_.import_('sys')
 for meta_importer in (pass_importer, succeed_importer):
 self.failUnlessEqual(meta_importer.find_request, ('sys', None))
@@ -593,7 +593,7 @@
 # when sys.path_importer_cache has a value of None.
 self.clear_sys_module('sys')
 succeed_importer = mock_importer.SucceedImporter()
- importer_ = importer.Importer(succeed_importer, tuple())
+ importer_ = importer.Import(succeed_importer, tuple())
 sys.meta_path = []
 sys.path = ['<succeed>']
 sys.path_importer_cache['<succeed>'] = None
@@ -604,7 +604,7 @@
 def test_search_sys_path(self):
 # Test sys.path searching for a loader.
 self.clear_sys_module('sys')
- importer_ = importer.Importer(extended_meta_path=())
+ importer_ = importer.Import(extended_meta_path=())
 sys.path = []
 sys_path = (mock_importer.PassImporter.set_on_sys_path(),
 mock_importer.SucceedImporter.set_on_sys_path())
@@ -671,7 +671,7 @@
 self.clear_sys_module('sys', '__hello__', 'time', 'token')
 # Restore sys.path for 'time' import.
 sys.path = self.old_sys_path
- import_ = importer.Importer()
+ import_ = importer.Import()
 # Built-ins.
 module = import_('sys')
 self.failUnlessEqual(module.__name__, 'sys')


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /