Skip to content

Commit

Permalink
importlib.readers not valid until python 3.10
Browse files Browse the repository at this point in the history
This exists https://github.com/python/cpython/blob/3.10/Lib/importlib/readers.py and FileReader is in there
This is a 404 https://github.com/python/cpython/blob/3.9/Lib/importlib/readers.py

This change needs to get backported to the 7.0.z branch(s) too
Fixes pytest-dev#9608
  • Loading branch information
kdelee authored and bluetech committed Feb 7, 2022
1 parent bc33ba0 commit 15ddccf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/_pytest/assertion/rewrite.py
Expand Up @@ -273,7 +273,7 @@ def get_data(self, pathname: Union[str, bytes]) -> bytes:
with open(pathname, "rb") as f:
return f.read()

if sys.version_info >= (3, 9):
if sys.version_info >= (3, 10):

def get_resource_reader(self, name: str) -> importlib.abc.TraversableResources: # type: ignore
from types import SimpleNamespace
Expand Down

0 comments on commit 15ddccf

Please sign in to comment.