diff Include/pyerrors.h @ 14170:019265b3a856 legacy-trunk

Improve the exceptions raised by PyErr_BadInternalCall(); adding the filename and line number of the call site to allow esier debugging. This closes SourceForge patch #101214.
author Fred Drake <fdrake@acm.org>
date Thu, 24 Aug 2000 22:38:39 +0000
parents 7e3cd9480f66
children 6dee1985c681
line wrap: on
line diff
--- a/Include/pyerrors.h	Thu Aug 24 22:27:02 2000 +0000
+++ b/Include/pyerrors.h	Thu Aug 24 22:38:39 2000 +0000
@@ -82,7 +82,12 @@
 extern DL_IMPORT(PyObject *) PyErr_SetFromWindowsErr(int);
 #endif
 
+/* Export the old function so that the existing API remains available: */
 extern DL_IMPORT(void) PyErr_BadInternalCall(void);
+extern DL_IMPORT(void) _PyErr_BadInternalCall(char *filename, int lineno);
+/* Mask the old API with a call to the new API for code compiled under
+   Python 2.0: */
+#define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__)
 
 /* Function to create a new exception */
 DL_IMPORT(PyObject *) PyErr_NewException(char *name, PyObject *base,