summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/cPickle.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c
index 9f426cc..6c70ad9 100644
--- a/Modules/cPickle.c
+++ b/Modules/cPickle.c
@@ -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;
}