mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
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.
This commit is contained in:
parent
9ed49e979f
commit
6d63adfbb7
2 changed files with 20 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue