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

Function SWIG_Python_AddErrorMsg

swig/python/export_wrap.cpp:1015–1036  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1013
1014
1015SWIGRUNTIME void
1016SWIG_Python_AddErrorMsg(const char* mesg)
1017{
1018 PyObject *type = 0;
1019 PyObject *value = 0;
1020 PyObject *traceback = 0;
1021
1022 if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
1023 if (value) {
1024 char *tmp;
1025 PyObject *old_str = PyObject_Str(value);
1026 PyErr_Clear();
1027 Py_XINCREF(type);
1028
1029 PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
1030 SWIG_Python_str_DelForPy3(tmp);
1031 Py_DECREF(old_str);
1032 Py_DECREF(value);
1033 } else {
1034 PyErr_SetString(PyExc_RuntimeError, mesg);
1035 }
1036}
1037
1038#if defined(SWIG_PYTHON_NO_THREADS)
1039# if defined(SWIG_PYTHON_THREADS)

Callers 1

SwigPySequence_RefClass · 0.85

Calls 1

SWIG_Python_str_AsCharFunction · 0.85

Tested by

no test coverage detected