summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-11-27 21:53:14 (GMT)
committerGuido van Rossum <guido@python.org>2000-11-27 21:53:14 (GMT)
commitf8baad0f1759a5b26b050636fd327e874e17c5a0 (patch)
tree0a94b982de21f78f39d078dabca1f5993400ad5f /Lib
parentb7a52c9de354de13037868d62347d3564dd54961 (diff)
downloadcpython-f8baad0f1759a5b26b050636fd327e874e17c5a0.zip
cpython-f8baad0f1759a5b26b050636fd327e874e17c5a0.tar.gz
cpython-f8baad0f1759a5b26b050636fd327e874e17c5a0.tar.bz2
Patch by Finn Bock to support PyStringMap in Jython.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/copy.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/copy.py b/Lib/copy.py
index 9576575..fc2e1ff 100644
--- a/Lib/copy.py
+++ b/Lib/copy.py
@@ -56,6 +56,11 @@ class Error(Exception):
pass
error = Error # backward compatibility
+try:
+ from org.python.core import PyStringMap
+except ImportError:
+ PyStringMap = None
+
def copy(x):
"""Shallow copy operation on arbitrary Python objects.
@@ -104,6 +109,8 @@ d[types.TupleType] = _copy_tuple
def _copy_dict(x):
return x.copy()
d[types.DictionaryType] = _copy_dict
+if PyStringMap is not None:
+ d[PyStringMap] = _copy_dict
def _copy_inst(x):
if hasattr(x, '__copy__'):
@@ -200,6 +207,8 @@ def _deepcopy_dict(x, memo):
y[deepcopy(key, memo)] = deepcopy(x[key], memo)
return y
d[types.DictionaryType] = _deepcopy_dict
+if PyStringMap is not None:
+ d[PyStringMap] = _deepcopy_dict
def _keep_alive(x, memo):
"""Keeps a reference to the object x in the memo.