From 666c4ec067ca4ecb1bf7dbb6c4cdd5ff3a58032a Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Thu, 22 Jul 2010 15:54:36 +0200 Subject: [PATCH] [FIX] mutable default in tools lp bug: https://launchpad.net/bugs/525808 fixed bzr revid: ls@numerigraphe.fr-20100722135436-grgj7vow495q65vf --- bin/tools/convert.py | 2 +- bin/tools/copy.py | 4 +++- bin/tools/pdf_utils.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/tools/convert.py b/bin/tools/convert.py index 973e762cd2e..20f54e15f11 100644 --- a/bin/tools/convert.py +++ b/bin/tools/convert.py @@ -598,7 +598,7 @@ form: module.record_id""" % (xml_id,) self.pool.get('ir.model.data').ir_set(cr, self.uid, 'action', 'tree_but_open', 'Menuitem', [('ir.ui.menu', int(pid))], action, True, True, xml_id=rec_id) return ('ir.ui.menu', pid) - def _assert_equals(self, f1, f2, prec = 4): + def _assert_equals(self, f1, f2, prec=4): return not round(f1 - f2, prec) def _tag_assert(self, cr, rec, data_node=None): 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) diff --git a/bin/tools/pdf_utils.py b/bin/tools/pdf_utils.py index 4782e544429..0286b9cf46d 100644 --- a/bin/tools/pdf_utils.py +++ b/bin/tools/pdf_utils.py @@ -58,7 +58,7 @@ trailer %%EOF """ -def output_field( f ): +def output_field(f): return "\xfe\xff" + "".join( [ "\x00"+c for c in f ] ) def extract_keys(lines):