MCPcopy Create free account
hub / github.com/chokkan/crfsuite / SWIG_Python_AddErrMesg

Function SWIG_Python_AddErrMesg

swig/python/export_wrap.cpp:2774–2799  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2772#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
2773
2774SWIGRUNTIME int
2775SWIG_Python_AddErrMesg(const char* mesg, int infront)
2776{
2777 if (PyErr_Occurred()) {
2778 PyObject *type = 0;
2779 PyObject *value = 0;
2780 PyObject *traceback = 0;
2781 PyErr_Fetch(&type, &value, &traceback);
2782 if (value) {
2783 char *tmp;
2784 PyObject *old_str = PyObject_Str(value);
2785 Py_XINCREF(type);
2786 PyErr_Clear();
2787 if (infront) {
2788 PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
2789 } else {
2790 PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
2791 }
2792 SWIG_Python_str_DelForPy3(tmp);
2793 Py_DECREF(old_str);
2794 }
2795 return 1;
2796 } else {
2797 return 0;
2798 }
2799}
2800
2801SWIGRUNTIME int
2802SWIG_Python_ArgFail(int argnum)

Callers 1

SWIG_Python_ArgFailFunction · 0.85

Calls 1

SWIG_Python_str_AsCharFunction · 0.85

Tested by

no test coverage detected