]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix SF bug 610610 (reported by Martijn Pieters, diagnosed by Neal Norwitz).
authorGuido van Rossum <guido@python.org>
Wed, 18 Sep 2002 04:06:32 +0000 (04:06 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 18 Sep 2002 04:06:32 +0000 (04:06 +0000)
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).

Python/exceptions.c

index 3f07089641b1fd1e06736f4f2787b801a8db4668..03affdc8431a7e763836bf8a43305c045ff331b0 100644 (file)
@@ -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;