Skip to content

Commit 8be54d3

Browse files
committed
pythonGH-103247: bypass the import cache on the _require_loader helper
This is not a fix for the importlib test monkeypatching leakage but it's something that we probably should be doing anyway. Signed-off-by: Filipe Laíns <[email protected]>
1 parent fa86a77 commit 8be54d3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/test_import/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from unittest import mock
2525
import _testinternalcapi
2626

27+
from test.support import import_helper
2728
from test.support import os_helper
2829
from test.support import (
2930
STDLIB_DIR, swap_attr, swap_item, cpython_only, is_emscripten,
@@ -57,7 +58,7 @@
5758

5859
def _require_loader(module, loader, skip):
5960
if isinstance(module, str):
60-
module = __import__(module)
61+
module = import_helper.import_fresh_module(module)
6162

6263
MODULE_KINDS = {
6364
BuiltinImporter: 'built-in',

0 commit comments

Comments
 (0)