Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Doc/library/importlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -813,9 +813,6 @@ ABC hierarchy::
methods. Therefore, any loader supplying TraversableReader
also supplies ResourceReader.

Loaders that wish to support resource reading are expected to
implement this interface.

.. versionadded:: 3.9


Expand Down
12 changes: 1 addition & 11 deletions Lib/importlib/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,7 @@ def from_package(package):
Return a Traversable object for the given package.

"""
spec = package.__spec__
return from_traversable_resources(spec) or fallback_resources(spec)


def from_traversable_resources(spec):
"""
If the spec.loader implements TraversableResources,
directly or implicitly, it will have a ``files()`` method.
"""
with contextlib.suppress(AttributeError):
return spec.loader.files()
return fallback_resources(package.__spec__)


def fallback_resources(spec):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed support for loaders implementing .files and supplying TraversableResources.