mirror of
https://github.com/python/cpython.git
synced 2025-07-30 22:54:16 +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
|
@ -7,7 +7,7 @@ import imp
|
|||
import marshal
|
||||
import os
|
||||
import sys
|
||||
import new
|
||||
import types
|
||||
import struct
|
||||
|
||||
if hasattr(sys.__stdout__, "newlines"):
|
||||
|
@ -594,7 +594,7 @@ class ModuleFinder:
|
|||
if isinstance(consts[i], type(co)):
|
||||
consts[i] = self.replace_paths_in_code(consts[i])
|
||||
|
||||
return new.code(co.co_argcount, co.co_nlocals, co.co_stacksize,
|
||||
return types.CodeType(co.co_argcount, co.co_nlocals, co.co_stacksize,
|
||||
co.co_flags, co.co_code, tuple(consts), co.co_names,
|
||||
co.co_varnames, new_filename, co.co_name,
|
||||
co.co_firstlineno, co.co_lnotab,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue