mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
PEP 3151 / issue #12555: reworking the OS and IO exception hierarchy.
This commit is contained in:
parent
983b1434bd
commit
6b4883dec0
21 changed files with 689 additions and 454 deletions
|
@ -622,14 +622,14 @@ static Py_ssize_t *
|
|||
_buffered_check_blocking_error(void)
|
||||
{
|
||||
PyObject *t, *v, *tb;
|
||||
PyBlockingIOErrorObject *err;
|
||||
PyOSErrorObject *err;
|
||||
|
||||
PyErr_Fetch(&t, &v, &tb);
|
||||
if (v == NULL || !PyErr_GivenExceptionMatches(v, PyExc_BlockingIOError)) {
|
||||
PyErr_Restore(t, v, tb);
|
||||
return NULL;
|
||||
}
|
||||
err = (PyBlockingIOErrorObject *) v;
|
||||
err = (PyOSErrorObject *) v;
|
||||
/* TODO: sanity check (err->written >= 0) */
|
||||
PyErr_Restore(t, v, tb);
|
||||
return &err->written;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue