Skip to content

Commit

Permalink
Ensure stdlib readers are excluded on Python 3.10 even when found in …
Browse files Browse the repository at this point in the history
…importlib.readers. Closes #257.
  • Loading branch information
jaraco committed Mar 16, 2024
1 parent d7b6cfb commit d9e44b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 2 additions & 1 deletion importlib_resources/future/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def wrapper(*args, **kwargs):
# MultiplexedPath may fail on zip subdirectory
return
# Python 3.10+
if reader.__class__.__module__.startswith('importlib.resources.'):
mod_name = reader.__class__.__module__
if mod_name.startswith('importlib.') and mod_name.endswith('readers'):
return
# Python 3.8, 3.9
if isinstance(reader, _adapters.CompatibilityFiles) and (
Expand Down
3 changes: 0 additions & 3 deletions importlib_resources/tests/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import importlib
import contextlib

import pytest

import importlib_resources as resources
from ..abc import Traversable
from . import data01
Expand Down Expand Up @@ -36,7 +34,6 @@ def test_read_text(self):
def test_traversable(self):
assert isinstance(resources.files(self.data), Traversable)

@pytest.mark.xfail("sys.version_info[:2] == (3, 10)", reason="#257")
def test_joinpath_with_multiple_args(self):
files = resources.files(self.data)
binfile = files.joinpath('subdirectory', 'binary.file')
Expand Down

0 comments on commit d9e44b6

Please sign in to comment.