From 764b984db508f40d7add9162920681827f3f22d5 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Thu, 28 May 1998 04:33:37 +0000 Subject: [PATCH] Use PyErr_ExceptionMatches(...) instead of PyErr_Occurred() == ... in two places. --- Modules/cPickle.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 9f426cc1052..6c70ad9cb49 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; }