From: Guido van Rossum Date: Wed, 18 Sep 2002 04:06:32 +0000 (+0000) Subject: Fix SF bug 610610 (reported by Martijn Pieters, diagnosed by Neal Norwitz). X-Git-Tag: v2.3c1~4028 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=98b2a42bc48a82718b36b9da094b1f6d24825967;p=thirdparty%2FPython%2Fcpython.git Fix SF bug 610610 (reported by Martijn Pieters, diagnosed by Neal Norwitz). The switch in Exception__str__ didn't clear the error if PySequence_Size() raised an exception. Added a case -1 which clears the error and falls through to the default case. Definite backport candidate (this dates all the way to Python 2.0). --- diff --git a/Python/exceptions.c b/Python/exceptions.c index 3f07089641b1..03affdc8431a 100644 --- a/Python/exceptions.c +++ b/Python/exceptions.c @@ -288,6 +288,9 @@ Exception__str__(PyObject *self, PyObject *args) out = NULL; break; } + case -1: + PyErr_Clear(); + /* Fall through */ default: out = PyObject_Str(args); break;