mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
Replaced import of the 'new' module with 'types' module and added a deprecation warning to the 'new' module.
This commit is contained in:
parent
8b01140d2c
commit
c756d00cf2
10 changed files with 52 additions and 81 deletions
|
@ -203,9 +203,9 @@ class TestRetrievingSourceCode(GetSourceBase):
|
|||
self.assertEqual(inspect.getfile(mod.StupidGit), mod.__file__)
|
||||
|
||||
def test_getmodule_recursion(self):
|
||||
from new import module
|
||||
from types import ModuleType
|
||||
name = '__inspect_dummy'
|
||||
m = sys.modules[name] = module(name)
|
||||
m = sys.modules[name] = ModuleType(name)
|
||||
m.__file__ = "<string>" # hopefully not a real filename...
|
||||
m.__loader__ = "dummy" # pretend the filename is understood by a loader
|
||||
exec "def x(): pass" in m.__dict__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue