summaryrefslogtreecommitdiffstats
path: root/Lib/test/regrtest.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-11-14 18:42:51 (GMT)
committerBrett Cannon <brett@python.org>2012-11-14 18:42:51 (GMT)
commit613cf25d2af6640b82ce56cb3e270fdaa027e6ad (patch)
tree3311d434c81061ca9bf295b2b5651d89977180aa /Lib/test/regrtest.py
parent2eb2f5e3597499b0c72b50bb5ed26da0e1cb65b9 (diff)
downloadcpython-613cf25d2af6640b82ce56cb3e270fdaa027e6ad.zip
cpython-613cf25d2af6640b82ce56cb3e270fdaa027e6ad.tar.gz
cpython-613cf25d2af6640b82ce56cb3e270fdaa027e6ad.tar.bz2
Use importlib instead of calling __import__ directly.
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-xLib/test/regrtest.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index c342d43..550a34d 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -1210,8 +1210,7 @@ def runtest_inner(test, verbose, quiet,
abstest = 'test.' + test
with saved_test_environment(test, verbose, quiet) as environment:
start_time = time.time()
- the_package = __import__(abstest, globals(), locals(), [])
- the_module = getattr(the_package, test)
+ the_module = importlib.import_module(abstest)
# If the test has a test_main, that will run the appropriate
# tests. If not, use normal unittest test loading.
test_runner = getattr(the_module, "test_main", None)