summaryrefslogtreecommitdiff
path: root/bin/tools/copy.py
diff options
context:
space:
mode:
authorNumerigraphe - Lionel Sausin <ls@numerigraphe.fr>2010-07-22 15:54:36 +0200
committerNumerigraphe - Lionel Sausin <ls@numerigraphe.fr>2010-07-22 15:54:36 +0200
commit666c4ec067ca4ecb1bf7dbb6c4cdd5ff3a58032a (patch)
tree941f44ff8af66438eac5f0701b215c333a2fa20f /bin/tools/copy.py
parent70fd90d33b2ebb25519d89b3505f616d2b6f7fa1 (diff)
[FIX] mutable default in tools
lp bug: https://launchpad.net/bugs/525808 fixed bzr revid: ls@numerigraphe.fr-20100722135436-grgj7vow495q65vf
Diffstat (limited to 'bin/tools/copy.py')
-rw-r--r--bin/tools/copy.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/tools/copy.py b/bin/tools/copy.py
index e6583dcfadf..badd4d51fc5 100644
--- a/bin/tools/copy.py
+++ b/bin/tools/copy.py
@@ -164,7 +164,7 @@ d[types.InstanceType] = _copy_inst
del d
-def deepcopy(x, memo=None, _nil=[]):
+def deepcopy(x, memo=None, _nil=None):
"""Deep copy operation on arbitrary Python objects.
See the module's __doc__ string for more info.
@@ -172,6 +172,8 @@ def deepcopy(x, memo=None, _nil=[]):
if memo is None:
memo = {}
+ if _nil is None:
+ _nil = {}
d = id(x)
y = memo.get(d, _nil)