From dbaf53a26a842ff948884fa59feafd0edeae8d64 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 20 Dec 2021 16:43:02 +0100 Subject: [PATCH] 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 --- src/App/ObjectIdentifier.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/App/ObjectIdentifier.cpp b/src/App/ObjectIdentifier.cpp index a809ce9acd..234d740ae6 100644 --- a/src/App/ObjectIdentifier.cpp +++ b/src/App/ObjectIdentifier.cpp @@ -1111,8 +1111,7 @@ ObjectIdentifier::getDep(bool needProps, std::vector *labels) const return deps; } -void ObjectIdentifier::getDep( - Dependencies &deps, bool needProps, std::vector *labels) const +void ObjectIdentifier::getDep(Dependencies &deps, bool needProps, std::vector *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(); } }