Skip to content

Commit c927fd9

Browse files
[3.13] gh-128816: Fix warnings in test_doctest (GH-128817) (GH-128870)
* Fix a deprecation warning for using importlib.resources.abc.ResourceReader. * Fix an import warning when importing readline (if it has not yet been imported). (cherry picked from commit 599be68) Co-authored-by: Thomas Grainger <[email protected]>
1 parent 714b851 commit c927fd9

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
@@ -2872,7 +2872,7 @@ def test_testfile(): r"""
28722872
>>> _colorize.COLORIZE = save_colorize
28732873
"""
28742874

2875-
class TestImporter(importlib.abc.MetaPathFinder, importlib.abc.ResourceLoader):
2875+
class TestImporter(importlib.abc.MetaPathFinder):
28762876

28772877
def find_spec(self, fullname, path, target=None):
28782878
return importlib.util.spec_from_file_location(fullname, path, loader=self)
@@ -2881,6 +2881,12 @@ def get_data(self, path):
28812881
with open(path, mode='rb') as f:
28822882
return f.read()
28832883

2884+
def exec_module(self, module):
2885+
raise ImportError
2886+
2887+
def create_module(self, spec):
2888+
return None
2889+
28842890
class TestHook:
28852891

28862892
def __init__(self, pathdir):

0 commit comments

Comments
 (0)