From b62a06ecb8a6e30734e0249ca8616f8a1d3a5dff Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Thu, 30 Jul 2009 17:45:37 +0100 Subject: [PATCH] clear exception after checking if virtual method is implemented. --- pybindgen/cppmethod.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pybindgen/cppmethod.py b/pybindgen/cppmethod.py index c11459c..386bbae 100644 --- a/pybindgen/cppmethod.py +++ b/pybindgen/cppmethod.py @@ -810,7 +810,7 @@ class CppVirtualMethodProxy(ReverseWrapperBase): ## just chain to parent class and don't do anything else call_params = ', '.join([param.name for param in self.parameters]) py_method = self.declarations.declare_variable('PyObject*', 'py_method') - self.before_call.write_code('%s = PyObject_GetAttrString(m_pyself, (char *) "_%s");' + self.before_call.write_code('%s = PyObject_GetAttrString(m_pyself, (char *) "_%s"); PyErr_Clear();' % (py_method, self.method_name)) self.before_call.add_cleanup_code('Py_XDECREF(%s);' % py_method)