From b989b99d5d590af8f5bc6dedd5e9471970eb3597 Mon Sep 17 00:00:00 2001 From: christos <christos@cern.ch> Date: Thu, 11 Oct 2018 23:48:14 +0100 Subject: [PATCH] look https://mail.python.org/pipermail/python-dev/2010-April/099459.html --- Reconstruction/egamma/egammaRec/python/Factories.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Reconstruction/egamma/egammaRec/python/Factories.py b/Reconstruction/egamma/egammaRec/python/Factories.py index 770e12fd1a3..0b39b6a183d 100644 --- a/Reconstruction/egamma/egammaRec/python/Factories.py +++ b/Reconstruction/egamma/egammaRec/python/Factories.py @@ -141,7 +141,9 @@ class Factory: def copy(self, name, **kw): "copy(self, name, **kw) --> return a new instance of the factory with new name and defaults" kw['name'] = name - return self.__class__(self.iclass, **dict(self.defaults, **kw) ) + deflt = self.defaults.copy() + deflt.update(kw) + return self.__class__(self.iclass, **deflt ) def __call__(self, name = '', **kw ): """Call preInit functions, instantiate tool (alg), call postInit functions and add -- GitLab