From 0c0ae77f2c655cb2e4c2330b45c70dba5a30654d Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Tue, 27 Aug 2019 20:19:51 +0800 Subject: [PATCH] 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. --- src/Base/Interpreter.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Base/Interpreter.h b/src/Base/Interpreter.h index c2d404a3bc..3116e67c7d 100644 --- a/src/Base/Interpreter.h +++ b/src/Base/Interpreter.h @@ -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); }