From 9e2cf04cecf09f6f9ddd47bc2a0c29812f38b201 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Mon, 6 Oct 2008 16:07:41 +0100 Subject: [PATCH] Need to clear exception when type checking fails --- pybindgen/cppclass.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pybindgen/cppclass.py b/pybindgen/cppclass.py index d62c9d1..d292ace 100644 --- a/pybindgen/cppclass.py +++ b/pybindgen/cppclass.py @@ -1541,6 +1541,7 @@ typedef struct { code_sink.writeln("return %s(&result);" % retval_converter) code_sink.unindent() code_sink.writeln("}") + code_sink.writeln("PyErr_Clear();") code_sink.unindent() code_sink.writeln("}")