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):