Base: fix pyCall() exception

This function is wildly used in FeaturePython and
ViewProviderPythonFeature, which explicitly catches Py::Exception, not
Base::Exception. So pyCall() should throw Py::Exception, too.
This commit is contained in:
Zheng, Lei
2019-08-27 20:19:51 +08:00
committed by wmayer
parent a7a34ab983
commit 0c0ae77f2c

View File

@@ -124,14 +124,14 @@ protected:
inline Py::Object pyCall(PyObject *callable, PyObject *args=0) {
PyObject *result = PyObject_CallObject(callable, args);
if(!result)
Base::PyException::ThrowException();
throw Py::Exception();
return Py::asObject(result);
}
inline Py::Object pyCallWithKeywords(PyObject *callable, PyObject *args, PyObject *kwds=0) {
PyObject *result = PyObject_Call(callable, args, kwds);
if(!result)
Base::PyException::ThrowException();
throw Py::Exception();
return Py::asObject(result);
}