mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Issue #17177: stop using imp in test_importlib
This commit is contained in:
parent
53e600c24a
commit
ef888024d8
16 changed files with 78 additions and 76 deletions
|
@ -1,9 +1,9 @@
|
|||
from contextlib import contextmanager
|
||||
import imp
|
||||
import os.path
|
||||
from test import support
|
||||
import unittest
|
||||
import sys
|
||||
import types
|
||||
|
||||
|
||||
CASE_INSENSITIVE_FS = True
|
||||
|
@ -98,7 +98,7 @@ class mock_modules:
|
|||
package = name.rsplit('.', 1)[0]
|
||||
else:
|
||||
package = import_name
|
||||
module = imp.new_module(import_name)
|
||||
module = types.ModuleType(import_name)
|
||||
module.__loader__ = self
|
||||
module.__file__ = '<mock __file__>'
|
||||
module.__package__ = package
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue