mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +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
|
@ -368,12 +368,25 @@ PyObject *PyErr_SetFromWindowsErr(int ierr)
|
|||
}
|
||||
#endif /* MS_WINDOWS */
|
||||
|
||||
void
|
||||
_PyErr_BadInternalCall(char *filename, int lineno)
|
||||
{
|
||||
PyErr_Format(PyExc_SystemError,
|
||||
"%s:%d: bad argument to internal function",
|
||||
filename, lineno);
|
||||
}
|
||||
|
||||
/* Remove the preprocessor macro for PyErr_BadInternalCall() so that we can
|
||||
export the entry point for existing object code: */
|
||||
#undef PyErr_BadInternalCall
|
||||
void
|
||||
PyErr_BadInternalCall(void)
|
||||
{
|
||||
PyErr_SetString(PyExc_SystemError,
|
||||
"bad argument to internal function");
|
||||
PyErr_Format(PyExc_SystemError,
|
||||
"bad argument to internal function");
|
||||
}
|
||||
#define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__)
|
||||
|
||||
|
||||
|
||||
PyObject *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue