mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +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
|
@ -1,7 +1,7 @@
|
|||
"""A flow graph representation for Python bytecode"""
|
||||
|
||||
import dis
|
||||
import new
|
||||
import types
|
||||
import sys
|
||||
|
||||
from compiler import misc
|
||||
|
@ -595,7 +595,7 @@ class PyFlowGraph(FlowGraph):
|
|||
argcount = self.argcount
|
||||
if self.flags & CO_VARKEYWORDS:
|
||||
argcount = argcount - 1
|
||||
return new.code(argcount, nlocals, self.stacksize, self.flags,
|
||||
return types.CodeType(argcount, nlocals, self.stacksize, self.flags,
|
||||
self.lnotab.getCode(), self.getConsts(),
|
||||
tuple(self.names), tuple(self.varnames),
|
||||
self.filename, self.name, self.lnotab.firstline,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue