Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e8bbfeb

Browse files
[issue19951] Fix docstring and use of _get_suppported_file_loaders() to reflect 2-tuples.
1 parent 0e61ed8 commit e8bbfeb

3 files changed

Lines changed: 1934 additions & 1933 deletions

File tree

Lib/importlib/_bootstrap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ def find_module(cls, fullname, path=None):
881881
_os.stat(filepath)
882882
except OSError:
883883
return None
884-
for loader, suffixes, _ in _get_supported_file_loaders():
884+
for loader, suffixes in _get_supported_file_loaders():
885885
if filepath.endswith(tuple(suffixes)):
886886
return loader(fullname, filepath)
887887

@@ -1670,7 +1670,7 @@ def _calc___package__(globals):
16701670
def _get_supported_file_loaders():
16711671
"""Returns a list of file-based module loaders.
16721672
1673-
Each item is a tuple (loader, suffixes, allow_packages).
1673+
Each item is a tuple (loader, suffixes).
16741674
"""
16751675
extensions = ExtensionFileLoader, _imp.extension_suffixes()
16761676
source = SourceFileLoader, SOURCE_SUFFIXES

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ Library
358358
- Issue #18598: Tweak exception message for importlib.import_module() to
359359
include the module name when a key argument is missing.
360360

361+
- Issue #19951: Fix docstring and use of _get_suppported_file_loaders() to
362+
reflect 2-tuples.
363+
361364
- Issue #18676: Change 'positive' to 'non-negative' in queue.py put and get
362365
docstrings and ValueError messages. Patch by Zhongyue Luo
363366

0 commit comments

Comments
 (0)