mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-99482: remove jython
compatibility parts from stdlib and tests (#99484)
This commit is contained in:
parent
c5726b727e
commit
745545b5bb
20 changed files with 134 additions and 232 deletions
12
Lib/copy.py
12
Lib/copy.py
|
@ -56,11 +56,6 @@ class Error(Exception):
|
|||
pass
|
||||
error = Error # backward compatibility
|
||||
|
||||
try:
|
||||
from org.python.core import PyStringMap
|
||||
except ImportError:
|
||||
PyStringMap = None
|
||||
|
||||
__all__ = ["Error", "copy", "deepcopy"]
|
||||
|
||||
def copy(x):
|
||||
|
@ -120,9 +115,6 @@ d[dict] = dict.copy
|
|||
d[set] = set.copy
|
||||
d[bytearray] = bytearray.copy
|
||||
|
||||
if PyStringMap is not None:
|
||||
d[PyStringMap] = PyStringMap.copy
|
||||
|
||||
del d, t
|
||||
|
||||
def deepcopy(x, memo=None, _nil=[]):
|
||||
|
@ -231,8 +223,6 @@ def _deepcopy_dict(x, memo, deepcopy=deepcopy):
|
|||
y[deepcopy(key, memo)] = deepcopy(value, memo)
|
||||
return y
|
||||
d[dict] = _deepcopy_dict
|
||||
if PyStringMap is not None:
|
||||
d[PyStringMap] = _deepcopy_dict
|
||||
|
||||
def _deepcopy_method(x, memo): # Copy instance methods
|
||||
return type(x)(x.__func__, deepcopy(x.__self__, memo))
|
||||
|
@ -301,4 +291,4 @@ def _reconstruct(x, memo, func, args,
|
|||
y[key] = value
|
||||
return y
|
||||
|
||||
del types, weakref, PyStringMap
|
||||
del types, weakref
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue