diff options
author | Brett Cannon <brett@python.org> | 2015-01-09 16:39:21 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2015-01-09 16:39:21 (GMT) |
commit | 02d845400275076ef5ba2791c74b7670ac21f8a9 (patch) | |
tree | 36077086a1bd393ede07d99c61ed7137bd5bdcc3 /Lib/test/test_pkgutil.py | |
parent | 863c69cfebcafbf97ba401e0f3cd5cb077e0e8f2 (diff) | |
download | cpython-02d845400275076ef5ba2791c74b7670ac21f8a9.zip cpython-02d845400275076ef5ba2791c74b7670ac21f8a9.tar.gz cpython-02d845400275076ef5ba2791c74b7670ac21f8a9.tar.bz2 |
Issue #23014: Make importlib.abc.Loader.create_module() required when
importlib.abc.Loader.exec_module() is also defined.
Before this change, create_module() was optional **and** could return
None to trigger default semantics. This change now reduces the
options for choosing default semantics to one and in the most
backporting-friendly way (define create_module() to return None).
Diffstat (limited to 'Lib/test/test_pkgutil.py')
-rw-r--r-- | Lib/test/test_pkgutil.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py index e0c8635de..57ebf1f 100644 --- a/Lib/test/test_pkgutil.py +++ b/Lib/test/test_pkgutil.py @@ -104,6 +104,9 @@ class PkgutilTests(unittest.TestCase): class PkgutilPEP302Tests(unittest.TestCase): class MyTestLoader(object): + def create_module(self, spec): + return None + def exec_module(self, mod): # Count how many times the module is reloaded mod.__dict__['loads'] = mod.__dict__.get('loads', 0) + 1 |