diff --git a/Control/StoreGateBindings/python/Bindings.py b/Control/StoreGateBindings/python/Bindings.py index 8400673b2e54284944ef76b90fe69efdd169be0e..cc8f7c746c5d75a9c08e0131cd3c603a37d7b3ca 100644 --- a/Control/StoreGateBindings/python/Bindings.py +++ b/Control/StoreGateBindings/python/Bindings.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # @file: StoreGateBindings/python/Bindings.py # @author: Wim Lavrijsen <WLavrijsen@lbl.gov> @@ -83,7 +83,7 @@ def _setup(): # dict-pythonization of storegate: __getitem__ def __getitem__ (self, key): try: - ret = py_sg_getitem(self, key.encode()) + ret = py_sg_getitem(self, str(key).encode()) except LookupError as err: raise KeyError(str(err)) if ret and hasattr(ret,'setStore') and not ret.hasStore(): @@ -136,16 +136,16 @@ def _setup(): clid = self._pyclidsvc.clid(clid.__name__) if clid is None: return [p.name() for p in self.proxies()] - return list(self._cpp_keys(clid, allKeys)) + return [str(x) for x in self._cpp_keys(clid, allKeys)] StoreGateSvc._cpp_keys = StoreGateSvc.keys StoreGateSvc.keys = keys #The cppyy version that comes with ROOT v6.22 checks also __len__!=0 #when casting to bool. Since we defined a __len__ method, newly-created - #(empty) StoreGate instances are always casted to False and therfore + #(empty) StoreGate instances are always casted to False and therefore #considered invalid. - #Work-aroudn by implementing our own __bool__ method + #Work-around by implementing our own __bool__ method StoreGateSvc.__bool__ = lambda self : True return