summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2008-01-08 15:15:09 (GMT)
committerThomas Heller <theller@ctypes.org>2008-01-08 15:15:09 (GMT)
commit41f278ffa5babb0e704c9331030a58937a398902 (patch)
treed2ecf8c9d367d28f0ee373e48490b10db232b577
parent62182c8b7280fa2474e82e11980df87cb928b048 (diff)
downloadcpython-41f278ffa5babb0e704c9331030a58937a398902.zip
cpython-41f278ffa5babb0e704c9331030a58937a398902.tar.gz
cpython-41f278ffa5babb0e704c9331030a58937a398902.tar.bz2
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'
-rw-r--r--Modules/_ctypes/callbacks.c2
-rw-r--r--Modules/_ctypes/callproc.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c
index 5362584..6d2e133 100644
--- a/Modules/_ctypes/callbacks.c
+++ b/Modules/_ctypes/callbacks.c
@@ -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);
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index 5f20c11..07dc219 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -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;
}