Cleanup: early exit when there is no exception
Reduces noise in D9752, no functional change as PyErr_NormalizeException doesn't do anything when there is no exception set.
This commit is contained in:
@@ -124,8 +124,11 @@ void python_script_error_jump(const char *filepath, int *lineno, int *offset)
|
|||||||
*offset = 0;
|
*offset = 0;
|
||||||
|
|
||||||
PyErr_Fetch(&exception, &value, (PyObject **)&tb);
|
PyErr_Fetch(&exception, &value, (PyObject **)&tb);
|
||||||
|
if (exception == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (exception && PyErr_GivenExceptionMatches(exception, PyExc_SyntaxError)) {
|
if (PyErr_GivenExceptionMatches(exception, PyExc_SyntaxError)) {
|
||||||
/* no trace-back available when `SyntaxError`.
|
/* no trace-back available when `SyntaxError`.
|
||||||
* python has no API's to this. reference #parse_syntax_error() from pythonrun.c */
|
* python has no API's to this. reference #parse_syntax_error() from pythonrun.c */
|
||||||
PyErr_NormalizeException(&exception, &value, (PyObject **)&tb);
|
PyErr_NormalizeException(&exception, &value, (PyObject **)&tb);
|
||||||
|
|||||||
Reference in New Issue
Block a user