Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-128816: fix an import warning in test_doctest.py when importing re… #128817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jan 15, 2025
Merged
8 changes: 7 additions & 1 deletion 8 Lib/test/test_doctest/test_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2860,7 +2860,7 @@ def test_testfile(): r"""
>>> _colorize.COLORIZE = save_colorize
"""

class TestImporter(importlib.abc.MetaPathFinder, importlib.abc.ResourceLoader):
class TestImporter(importlib.abc.MetaPathFinder):

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

def exec_module(self, module):
raise ImportError
graingert marked this conversation as resolved.
Show resolved Hide resolved

def create_module(self, spec):
return None
graingert marked this conversation as resolved.
Show resolved Hide resolved

class TestHook:

def __init__(self, pathdir):
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.