Commit 41f278ff authored by Thomas Heller's avatar Thomas Heller

Use relative instead of absolute filenames in the C-level tracebacks.

This prevents traceback prints pointing to files in this way:

  File "\loewis\25\python\Modules\_ctypes\callbacks.c", line 206, in 'calling callback function'
parent 62182c8b
......@@ -201,7 +201,7 @@ static void _CallPythonObject(void *mem,
}
#define CHECK(what, x) \
if (x == NULL) _AddTraceback(what, __FILE__, __LINE__ - 1), PyErr_Print()
if (x == NULL) _AddTraceback(what, "_ctypes/callbacks.c", __LINE__ - 1), PyErr_Print()
result = PyObject_CallObject(callable, arglist);
CHECK("'calling callback function'", result);
......
......@@ -766,7 +766,7 @@ static PyObject *GetResult(PyObject *restype, void *result, PyObject *checker)
v = PyObject_CallFunctionObjArgs(checker, retval, NULL);
if (v == NULL)
_AddTraceback("GetResult", __FILE__, __LINE__-2);
_AddTraceback("GetResult", "_ctypes/callproc.c", __LINE__-2);
Py_DECREF(retval);
return v;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment