Skip to content

Commit 599be68

Browse files
authored
gh-128816: Fix warnings in test_doctest (GH-128817)
* Fix a deprecation warning for using importlib.resources.abc.ResourceReader. * Fix an import warning when importing readline (if it has not yet been imported).
1 parent 1a1056d commit 599be68

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Lib/test/test_doctest/test_doctest.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -2860,7 +2860,7 @@ def test_testfile(): r"""
28602860
>>> _colorize.COLORIZE = save_colorize
28612861
"""
28622862

2863-
class TestImporter(importlib.abc.MetaPathFinder, importlib.abc.ResourceLoader):
2863+
class TestImporter(importlib.abc.MetaPathFinder):
28642864

28652865
def find_spec(self, fullname, path, target=None):
28662866
return importlib.util.spec_from_file_location(fullname, path, loader=self)
@@ -2869,6 +2869,12 @@ def get_data(self, path):
28692869
with open(path, mode='rb') as f:
28702870
return f.read()
28712871

2872+
def exec_module(self, module):
2873+
raise ImportError
2874+
2875+
def create_module(self, spec):
2876+
return None
2877+
28722878
class TestHook:
28732879

28742880
def __init__(self, pathdir):

0 commit comments

Comments
 (0)