GH-103247: bypass the import cache on the _require_loader helper

This commit is contained in:
Filipe Laíns 2023-08-24 22:05:03 +01:00 committed by GitHub
parent edb569e8e1
commit feb9a49c9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,6 +25,7 @@ from unittest import mock
import _testinternalcapi import _testinternalcapi
import _imp import _imp
from test.support import import_helper
from test.support import os_helper from test.support import os_helper
from test.support import ( from test.support import (
STDLIB_DIR, swap_attr, swap_item, cpython_only, is_emscripten, STDLIB_DIR, swap_attr, swap_item, cpython_only, is_emscripten,
@ -58,7 +59,7 @@ skip_if_dont_write_bytecode = unittest.skipIf(
def _require_loader(module, loader, skip): def _require_loader(module, loader, skip):
if isinstance(module, str): if isinstance(module, str):
module = __import__(module) module = import_helper.import_fresh_module(module)
MODULE_KINDS = { MODULE_KINDS = {
BuiltinImporter: 'built-in', BuiltinImporter: 'built-in',