Serhiy Storchaka <> added the comment:

There is usually more complex code between PyErr_Fetch() and 

        PyObject *exc, *val, *tb, *close_result;
        PyErr_Fetch(&exc, &val, &tb);
        close_result = _PyObject_CallMethodId(result, &PyId_close, NULL);
        _PyErr_ChainExceptions(exc, val, tb);

Many exceptions can be raised and silenced or overridden between, but we are 
interesting in chaining the only latest exception (or restoring the original 
exception if all exceptions between were silenced).


Python tracker <>
Python-bugs-list mailing list

Reply via email to