Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-41718: libregrtest runtest avoids import_helper
Inline import_helper.unload() in libregrtest.runtest to avoid one
import.
  • Loading branch information
vstinner committed Mar 22, 2021
commit 8df0591fe7fbceefa17e001c27a66ab60eb7e67d
6 changes: 4 additions & 2 deletions Lib/test/libregrtest/runtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import unittest

from test import support
from test.support import import_helper
from test.support import os_helper
from test.libregrtest.utils import clear_caches
from test.libregrtest.save_env import saved_test_environment
Expand Down Expand Up @@ -222,7 +221,10 @@ def _runtest_inner2(ns, test_name):
abstest = get_abs_module(ns, test_name)

# remove the module from sys.module to reload it if it was already imported
import_helper.unload(abstest)
try:
del sys.modules[abstest]
except KeyError:
pass

the_module = importlib.import_module(abstest)

Expand Down