[Python-checkins] cpython: abc fixes.

barry.warsaw python-checkins at python.org
Tue Jul 31 23:52:38 CEST 2012


http://hg.python.org/cpython/rev/b213894e0859
changeset:   78361:b213894e0859
user:        Barry Warsaw <barry at python.org>
date:        Tue Jul 31 17:52:32 2012 -0400
summary:
  abc fixes.

files:
  Lib/test/test_importlib/source/test_abc_loader.py  |  11 ++++++++++
  Lib/test/test_importlib/source/test_file_loader.py |   2 +
  2 files changed, 13 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_importlib/source/test_abc_loader.py b/Lib/test/test_importlib/source/test_abc_loader.py
--- a/Lib/test/test_importlib/source/test_abc_loader.py
+++ b/Lib/test/test_importlib/source/test_abc_loader.py
@@ -32,6 +32,9 @@
     def get_filename(self, fullname):
         return self.path
 
+    def module_repr(self, module):
+        return '<module>'
+
 
 class SourceLoaderMock(SourceOnlyLoaderMock):
 
@@ -107,6 +110,9 @@
             assert issubclass(w[0].category, DeprecationWarning)
             return path
 
+    def module_repr(self):
+        return '<module>'
+
 
 class PyLoaderCompatMock(PyLoaderMock):
 
@@ -779,11 +785,16 @@
     class Loader(abc.Loader):
         def load_module(self, fullname):
             super().load_module(fullname)
+        def module_repr(self, module):
+            super().module_repr(module)
 
     class Finder(abc.Finder):
         def find_module(self, _):
             super().find_module(_)
 
+        def find_loader(self, _):
+            super().find_loader(_)
+
     class ResourceLoader(Loader, abc.ResourceLoader):
         def get_data(self, _):
             super().get_data(_)
diff --git a/Lib/test/test_importlib/source/test_file_loader.py b/Lib/test/test_importlib/source/test_file_loader.py
--- a/Lib/test/test_importlib/source/test_file_loader.py
+++ b/Lib/test/test_importlib/source/test_file_loader.py
@@ -29,6 +29,7 @@
         # If fullname is not specified that assume self.name is desired.
         class TesterMixin(importlib.abc.Loader):
             def load_module(self, fullname): return fullname
+            def module_repr(self, module): return '<module>'
 
         class Tester(importlib.abc.FileLoader, TesterMixin):
             def get_code(self, _): pass
@@ -49,6 +50,7 @@
             def get_code(self, _): pass
             def get_source(self, _): pass
             def is_package(self, _): pass
+            def module_repr(self, _): pass
 
         path = 'some_path'
         name = 'some_name'

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list