]> granicus.if.org Git - python/commitdiff
Use relative instead of absolute filenames in the C-level tracebacks.
authorThomas Heller <theller@ctypes.org>
Tue, 8 Jan 2008 15:15:09 +0000 (15:15 +0000)
committerThomas Heller <theller@ctypes.org>
Tue, 8 Jan 2008 15:15:09 +0000 (15:15 +0000)
This prevents traceback prints pointing to files in this way:

  File "\loewis\25\python\Modules\_ctypes\callbacks.c", line 206, in 'calling callback function'

Modules/_ctypes/callbacks.c
Modules/_ctypes/callproc.c

index 5362584d50eeb69af563a61a42e2a7d27c043c8b..6d2e133bc7d7e2116936c45eb091dbf3fdb9f572 100644 (file)
@@ -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);
index 5f20c11286def1bd3864a167e0541e01c3539890..07dc219d16324990bdec2e2a8665c136bedba068 100644 (file)
@@ -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;
 }