Use PyErr_ExceptionMatches(...) instead of PyErr_Occurred() == ... in two

places.
This commit is contained in:
Fred Drake 1998-05-28 04:33:37 +00:00
parent 2b9d029308
commit 764b984db5

View File

@ -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;
}