"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Python/errors.c" between
Python-3.9.3.tar.xz and Python-3.9.4.tar.xz

About: Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes. Newest major release.

errors.c  (Python-3.9.3.tar.xz):errors.c  (Python-3.9.4.tar.xz)
skipping to change at line 284 skipping to change at line 284
eval_code2(), do_raise(), and PyErr_Print() eval_code2(), do_raise(), and PyErr_Print()
XXX: should PyErr_NormalizeException() also call XXX: should PyErr_NormalizeException() also call
PyException_SetTraceback() with the resulting value and tb? PyException_SetTraceback() with the resulting value and tb?
*/ */
void void
_PyErr_NormalizeException(PyThreadState *tstate, PyObject **exc, _PyErr_NormalizeException(PyThreadState *tstate, PyObject **exc,
PyObject **val, PyObject **tb) PyObject **val, PyObject **tb)
{ {
int recursion_depth = 0; int recursion_depth = 0;
tstate->recursion_headroom++;
PyObject *type, *value, *initial_tb; PyObject *type, *value, *initial_tb;
restart: restart:
type = *exc; type = *exc;
if (type == NULL) { if (type == NULL) {
/* There was no exception, so nothing to do. */ /* There was no exception, so nothing to do. */
tstate->recursion_headroom--;
return; return;
} }
value = *val; value = *val;
/* If PyErr_SetNone() was used, the value will have been actually /* If PyErr_SetNone() was used, the value will have been actually
set to NULL. set to NULL.
*/ */
if (!value) { if (!value) {
value = Py_None; value = Py_None;
Py_INCREF(value); Py_INCREF(value);
skipping to change at line 343 skipping to change at line 341
class of the type, believe the instance. class of the type, believe the instance.
*/ */
else if (inclass != type) { else if (inclass != type) {
Py_INCREF(inclass); Py_INCREF(inclass);
Py_DECREF(type); Py_DECREF(type);
type = inclass; type = inclass;
} }
} }
*exc = type; *exc = type;
*val = value; *val = value;
tstate->recursion_headroom--;
return; return;
error: error:
Py_DECREF(type); Py_DECREF(type);
Py_DECREF(value); Py_DECREF(value);
recursion_depth++; recursion_depth++;
if (recursion_depth == Py_NORMALIZE_RECURSION_LIMIT) { if (recursion_depth == Py_NORMALIZE_RECURSION_LIMIT) {
_PyErr_SetString(tstate, PyExc_RecursionError, _PyErr_SetString(tstate, PyExc_RecursionError,
"maximum recursion depth exceeded " "maximum recursion depth exceeded "
"while normalizing an exception"); "while normalizing an exception");
 End of changes. 3 change blocks. 
3 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)