gh-99482: remove jython compatibility parts from stdlib and tests (#99484)

This commit is contained in:
Nikita Sobolev 2022-12-23 23:17:24 +03:00 committed by GitHub
parent c5726b727e
commit 745545b5bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 134 additions and 232 deletions

View file

@ -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