Browse Source

[issue19951] Fix docstring and use of _get_suppported_file_loaders() to reflect 2-tuples.

pull/224/head
Eric Snow 12 years ago
parent
commit
e8bbfebee0
  1. 4
      Lib/importlib/_bootstrap.py
  2. 3
      Misc/NEWS
  3. 3860
      Python/importlib.h

4
Lib/importlib/_bootstrap.py

@ -881,7 +881,7 @@ class WindowsRegistryFinder:
_os.stat(filepath)
except OSError:
return None
for loader, suffixes, _ in _get_supported_file_loaders():
for loader, suffixes in _get_supported_file_loaders():
if filepath.endswith(tuple(suffixes)):
return loader(fullname, filepath)
@ -1670,7 +1670,7 @@ def _calc___package__(globals):
def _get_supported_file_loaders():
"""Returns a list of file-based module loaders.
Each item is a tuple (loader, suffixes, allow_packages).
Each item is a tuple (loader, suffixes).
"""
extensions = ExtensionFileLoader, _imp.extension_suffixes()
source = SourceFileLoader, SOURCE_SUFFIXES

3
Misc/NEWS

@ -358,6 +358,9 @@ Library
- Issue #18598: Tweak exception message for importlib.import_module() to
include the module name when a key argument is missing.
- Issue #19951: Fix docstring and use of _get_suppported_file_loaders() to
reflect 2-tuples.
- Issue #18676: Change 'positive' to 'non-negative' in queue.py put and get
docstrings and ValueError messages. Patch by Zhongyue Luo

3860
Python/importlib.h
File diff suppressed because it is too large
View File

Loading…
Cancel
Save