One way is to create an intermediate python function, which returns a
special value when an exception is caught.

def ExceptionCatcher(FunctionToCall):
    def F():
        try: FunctionToCall()
        except: return -1
        return 0
    return F

Then instead of calling your function, you would call
ExceptionCatcher(YourFunction). You can then check the return value in
your C++ code.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to