diff options
author | Guido van Rossum <guido@python.org> | 2002-09-18 04:06:32 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-09-18 04:06:32 +0000 |
commit | 4517faeb65bb4db016f3a6031f0e106558222fb6 (patch) | |
tree | 822c837c01e460585c81432cbac9c7313851dd91 /Python/exceptions.c | |
parent | a108bebad85b6be7f8d8854e7eda9d59a794f926 (diff) | |
download | cpython-4517faeb65bb4db016f3a6031f0e106558222fb6.tar.gz |
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).
Diffstat (limited to 'Python/exceptions.c')
-rw-r--r-- | Python/exceptions.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/exceptions.c b/Python/exceptions.c index 3f07089641..03affdc843 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; |