diff --git a/src/Gui/ViewProviderPythonFeature.cpp b/src/Gui/ViewProviderPythonFeature.cpp index 90f54a42ec..080a5fdccd 100644 --- a/src/Gui/ViewProviderPythonFeature.cpp +++ b/src/Gui/ViewProviderPythonFeature.cpp @@ -453,6 +453,12 @@ ViewProviderPythonFeatureImp::setEdit(int ModNum) } } catch (Py::Exception&) { + // If a runtime error occurred when calling setEdit + // then handle it like returning false + if (PyErr_ExceptionMatches(PyExc_RuntimeError)) { + PyErr_Clear(); + return Rejected; + } Base::PyException e; // extract the Python error text e.ReportException(); }