mirror of https://github.com/python/cpython.git
Use PyErr_ExceptionMatches(...) instead of PyErr_Occurred() == ... in two
places.
This commit is contained in:
parent
2b9d029308
commit
764b984db5
|
@ -3533,7 +3533,8 @@ load(Unpicklerobject *self) {
|
|||
break;
|
||||
}
|
||||
|
||||
if ((err = PyErr_Occurred()) == PyExc_EOFError) {
|
||||
err = PyErr_Occurred();
|
||||
if (err && PyErr_ExceptionMatches(PyExc_EOFError)) {
|
||||
PyErr_SetNone(PyExc_EOFError);
|
||||
goto err;
|
||||
}
|
||||
|
@ -3830,7 +3831,8 @@ noload(Unpicklerobject *self) {
|
|||
break;
|
||||
}
|
||||
|
||||
if ((err = PyErr_Occurred()) == PyExc_EOFError) {
|
||||
err = PyErr_Occurred();
|
||||
if (err && PyErr_ExceptionMatches(PyExc_EOFError)) {
|
||||
PyErr_SetNone(PyExc_EOFError);
|
||||
goto err;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue