Skip to content

Commit

Permalink
Update comments to reflect refreshed purpose.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Feb 25, 2024
1 parent 8b10d7e commit beb5011
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions importlib_resources/future/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class TraversableResourcesLoader(_adapters.TraversableResourcesLoader):
Adapt loaders to provide TraversableResources and other
compatibility.
Used primarily for Python 3.9 and earlier where the native
loaders do not yet implement TraversableResources.
Ensures the readers from importlib_resources are preferred
over stdlib readers.
"""

@property
Expand Down Expand Up @@ -58,10 +58,8 @@ def _file_reader(spec):

def wrap_spec(package):
"""
Construct a package spec with traversable compatibility
on the spec/loader/reader.
Supersedes _adapters.wrap_spec to use TraversableResourcesLoader
from above for older Python compatibility (<3.10).
Override _adapters.wrap_spec to use TraversableResourcesLoader
from above. Ensures that future behavior is always available on older
Pythons.
"""
return _adapters.SpecLoaderAdapter(package.__spec__, TraversableResourcesLoader)

0 comments on commit beb5011

Please sign in to comment.