Skip to content

Commit d9e44b6

Browse files
committed
Ensure stdlib readers are excluded on Python 3.10 even when found in importlib.readers. Closes #257.
1 parent d7b6cfb commit d9e44b6

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

importlib_resources/future/adapters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def wrapper(*args, **kwargs):
2424
# MultiplexedPath may fail on zip subdirectory
2525
return
2626
# Python 3.10+
27-
if reader.__class__.__module__.startswith('importlib.resources.'):
27+
mod_name = reader.__class__.__module__
28+
if mod_name.startswith('importlib.') and mod_name.endswith('readers'):
2829
return
2930
# Python 3.8, 3.9
3031
if isinstance(reader, _adapters.CompatibilityFiles) and (

importlib_resources/tests/test_files.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import importlib
55
import contextlib
66

7-
import pytest
8-
97
import importlib_resources as resources
108
from ..abc import Traversable
119
from . import data01
@@ -36,7 +34,6 @@ def test_read_text(self):
3634
def test_traversable(self):
3735
assert isinstance(resources.files(self.data), Traversable)
3836

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

0 commit comments

Comments
 (0)