diff options
author | Brett Cannon <brett@python.org> | 2013-06-15 21:11:25 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2013-06-15 21:11:25 (GMT) |
commit | 9529fbfd363959ee4e33baeebcc6c3bc0252b42c (patch) | |
tree | dd983d37097a74680b5037f287dc83aa9391bd36 /Lib/test/test_pkgutil.py | |
parent | 8a2a902f88ce2ab8d0e27a189a65e71aed6dd670 (diff) | |
download | cpython-9529fbfd363959ee4e33baeebcc6c3bc0252b42c.zip cpython-9529fbfd363959ee4e33baeebcc6c3bc0252b42c.tar.gz cpython-9529fbfd363959ee4e33baeebcc6c3bc0252b42c.tar.bz2 |
Issue #17177: Stop using imp in a bunch of tests
Diffstat (limited to 'Lib/test/test_pkgutil.py')
-rw-r--r-- | Lib/test/test_pkgutil.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py index fd06614..1f48853 100644 --- a/Lib/test/test_pkgutil.py +++ b/Lib/test/test_pkgutil.py @@ -1,12 +1,12 @@ from test.support import run_unittest, unload, check_warnings import unittest import sys -import imp import importlib import pkgutil import os import os.path import tempfile +import types import shutil import zipfile @@ -105,7 +105,7 @@ class PkgutilPEP302Tests(unittest.TestCase): class MyTestLoader(object): def load_module(self, fullname): # Create an empty module - mod = sys.modules.setdefault(fullname, imp.new_module(fullname)) + mod = sys.modules.setdefault(fullname, types.ModuleType(fullname)) mod.__file__ = "<%s>" % self.__class__.__name__ mod.__loader__ = self # Make it a package |