| 24017 | return NULL; |
| 24018 | } |
| 24019 | static void __Pyx_AddTraceback(const char *funcname, int c_line, |
| 24020 | int py_line, const char *filename) { |
| 24021 | PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; |
| 24022 | PyObject *replace = NULL, *getframe = NULL, *frame = NULL; |
| 24023 | PyObject *exc_type, *exc_value, *exc_traceback; |
| 24024 | int success = 0; |
| 24025 | if (c_line) { |
| 24026 | c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); |
| 24027 | } |
| 24028 | PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); |
| 24029 | code_object = __pyx_find_code_object(c_line ? -c_line : py_line); |
| 24030 | if (!code_object) { |
| 24031 | code_object = Py_CompileString("_getframe()", filename, Py_eval_input); |
| 24032 | if (unlikely(!code_object)) goto bad; |
| 24033 | py_py_line = PyLong_FromLong(py_line); |
| 24034 | if (unlikely(!py_py_line)) goto bad; |
| 24035 | if (c_line) { |
| 24036 | py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); |
| 24037 | } else { |
| 24038 | py_funcname = PyUnicode_FromString(funcname); |
| 24039 | } |
| 24040 | if (unlikely(!py_funcname)) goto bad; |
| 24041 | dict = PyDict_New(); |
| 24042 | if (unlikely(!dict)) goto bad; |
| 24043 | { |
| 24044 | PyObject *old_code_object = code_object; |
| 24045 | code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); |
| 24046 | Py_DECREF(old_code_object); |
| 24047 | } |
| 24048 | if (unlikely(!code_object)) goto bad; |
| 24049 | __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); |
| 24050 | } else { |
| 24051 | dict = PyDict_New(); |
| 24052 | } |
| 24053 | getframe = PySys_GetObject("_getframe"); |
| 24054 | if (unlikely(!getframe)) goto bad; |
| 24055 | if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; |
| 24056 | frame = PyEval_EvalCode(code_object, dict, dict); |
| 24057 | if (unlikely(!frame) || frame == Py_None) goto bad; |
| 24058 | success = 1; |
| 24059 | bad: |
| 24060 | PyErr_Restore(exc_type, exc_value, exc_traceback); |
| 24061 | Py_XDECREF(code_object); |
| 24062 | Py_XDECREF(py_py_line); |
| 24063 | Py_XDECREF(py_funcname); |
| 24064 | Py_XDECREF(dict); |
| 24065 | Py_XDECREF(replace); |
| 24066 | if (success) { |
| 24067 | PyTraceBack_Here( |
| 24068 | (struct _frame*)frame); |
| 24069 | } |
| 24070 | Py_XDECREF(frame); |
| 24071 | } |
| 24072 | #else |
| 24073 | static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( |
| 24074 | const char *funcname, int c_line, |
no test coverage detected