diff options
author | Fred Drake <fdrake@acm.org> | 2000-08-24 22:38:39 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-08-24 22:38:39 (GMT) |
commit | 6d63adfbb7e97b218bede1052d3826b3461e9c59 (patch) | |
tree | a586109a41da3627dee96786ace955b43e58db43 /Include/pyerrors.h | |
parent | 9ed49e979f342d0341d0208ea1ee12ad80835a91 (diff) | |
download | cpython-6d63adfbb7e97b218bede1052d3826b3461e9c59.zip cpython-6d63adfbb7e97b218bede1052d3826b3461e9c59.tar.gz cpython-6d63adfbb7e97b218bede1052d3826b3461e9c59.tar.bz2 |
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.
Diffstat (limited to 'Include/pyerrors.h')
-rw-r--r-- | Include/pyerrors.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Include/pyerrors.h b/Include/pyerrors.h index f461068..6e60353 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -82,7 +82,12 @@ extern DL_IMPORT(PyObject *) PyErr_SetFromWindowsErrWithFilename(int, const char 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, |