From 1610d7b02832453c14669931b97b1d4c8f998b8b Mon Sep 17 00:00:00 2001 From: Andre Sailer <andre.philippe.sailer@cern.ch> Date: Wed, 2 Oct 2019 13:44:10 +0200 Subject: [PATCH] DDG4:Python3: need to convert dictionary keys from unicode to str --- DDG4/python/DDG4.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DDG4/python/DDG4.py b/DDG4/python/DDG4.py index fce9ba3bd..4482c6a93 100644 --- a/DDG4/python/DDG4.py +++ b/DDG4/python/DDG4.py @@ -297,6 +297,13 @@ def _set(self, name, value): a = Interface.toAction(self) if isinstance(value, list): value = [str(x) for x in value] + if isinstance(value, dict): + tempDict = {} + for key, val in value.items(): + if isinstance(val, six.string_types): + val = str(val) + tempDict[str(key)] = val + value = tempDict if Interface.setProperty(a, str(name), str(value)): return msg = 'Geant4Action::SetProperty [Unhandled]: Cannot set ' + a.name() + '.' + name + ' = ' + str(value) -- GitLab