diff --git a/Control/StoreGateBindings/src/StoreGatePyExt.cxx b/Control/StoreGateBindings/src/StoreGatePyExt.cxx index 3a99a9e6ee88133d171335977973e91d7b5079cd..ac118718b0458db42ca764c5f7d16a789fe077c2 100755 --- a/Control/StoreGateBindings/src/StoreGatePyExt.cxx +++ b/Control/StoreGateBindings/src/StoreGatePyExt.cxx @@ -286,12 +286,11 @@ AthenaInternal::retrieveObjectFromStore( StoreGateSvc* store, const RootType& fromType = RootType::ByName(realName); if ( (bool)fromType ) { - RootObject realobj( fromType, dbb->object() ); - const RootType& toType = RootType::ByName( PyString_AS_STRING( pyname ) ); - const RootObject& finalobj = realobj.CastObject( toType ); + res = dbb->object(); + if (fromType.Class() && toType.Class()) + res = fromType.Class()->DynamicCast (toType.Class(), res); - res = (void*)finalobj.Address(); if ( res ) { objProxy = proxyDict->newPyDataObject(realName.c_str(), res); }