1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
// The SIP implementation of the handler_module test module.
%Module(name=imported_exceptions.handler_module)
%Exception std::exception(SIP_Exception) /PyName=StdException, Default/
{
%TypeHeaderCode
#include <exception>
%End
%RaiseCode
const char *detail = sipExceptionRef.what();
SIP_BLOCK_THREADS
#if SIP_ABI_MAJOR_VERSION >= 14
PyErr_SetString((PyObject *)sipGetPyType(sipModule, sipTypeID_std_exception), detail);
#else
PyErr_SetString(sipException_std_exception, detail);
#endif
SIP_UNBLOCK_THREADS
%End
};
|