summaryrefslogtreecommitdiffstats
path: root/Lib/lib-tk
diff options
context:
space:
mode:
authorGuilherme Polo <ggpolo@gmail.com>2009-02-02 20:28:59 (GMT)
committerGuilherme Polo <ggpolo@gmail.com>2009-02-02 20:28:59 (GMT)
commitb98cb43e4a4d374dde9d7aa665ee88a6d0edd6b9 (patch)
tree5af537d20aae054fcad502dff0d31342a8350c39 /Lib/lib-tk
parentb64c989efc3c6e4885a17b9a1bad7ad7ac37744a (diff)
downloadcpython-b98cb43e4a4d374dde9d7aa665ee88a6d0edd6b9.zip
cpython-b98cb43e4a4d374dde9d7aa665ee88a6d0edd6b9.tar.gz
cpython-b98cb43e4a4d374dde9d7aa665ee88a6d0edd6b9.tar.bz2
Moving to importlib
Diffstat (limited to 'Lib/lib-tk')
-rw-r--r--Lib/lib-tk/test/runtktests.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/lib-tk/test/runtktests.py b/Lib/lib-tk/test/runtktests.py
index 6c974cf..402c342 100644
--- a/Lib/lib-tk/test/runtktests.py
+++ b/Lib/lib-tk/test/runtktests.py
@@ -9,6 +9,7 @@ Extensions also should live in packages following the same rule as above.
import os
import sys
import unittest
+import importlib
import test.test_support
this_dir_path = os.path.abspath(os.path.dirname(__file__))
@@ -44,10 +45,8 @@ def get_tests_modules(basepath=this_dir_path, gui=True, packages=None):
for name in filenames:
try:
- yield __import__(
- "%s.%s" % (pkg_name, name[:-len(py_ext)]),
- fromlist=['']
- )
+ yield importlib.import_module(
+ ".%s" % name[:-len(py_ext)], pkg_name)
except test.test_support.ResourceDenied:
if gui:
raise