App: fix ObjectIdentifier::getDep

+ it's an obscure way to clear the error state by instantiating PyException, instead use the clear() method
+ do not handle unknown exceptions because this suppresses all exceptions and thus makes error search more complicated
This commit is contained in:
wmayer
2021-12-20 16:43:02 +01:00
parent cda8545a29
commit dbaf53a26a

View File

@@ -1111,8 +1111,7 @@ ObjectIdentifier::getDep(bool needProps, std::vector<std::string> *labels) const
return deps;
}
void ObjectIdentifier::getDep(
Dependencies &deps, bool needProps, std::vector<std::string> *labels) const
void ObjectIdentifier::getDep(Dependencies &deps, bool needProps, std::vector<std::string> *labels) const
{
ResolveResults result(*this);
if(labels)
@@ -1134,10 +1133,10 @@ void ObjectIdentifier::getDep(
Base::PyGILStateLocker lock;
try {
access(result,0,&deps);
}catch(Py::Exception &) {
Base::PyException e;
}catch(...){
access(result, nullptr, &deps);
}
catch (Py::Exception& e) {
e.clear();
}
}