[Python-checkins] python/dist/src/Python exceptions.c,1.28.6.1,1.28.6.2
gvanrossum@users.sourceforge.net
gvanrossum@users.sourceforge.net
Mon, 23 Sep 2002 14:19:46 -0700
Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv9852
Modified Files:
Tag: release22-maint
exceptions.c
Log Message:
Backported 1.39 and 1.40 from trunk:
1.39:
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.
1.40:
Two more cases of switch(PySequence_Size()) without checking for case -1.
(Same problem as last checkin for SF bug 610610)
Need to clear the error and proceed.
Index: exceptions.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/exceptions.c,v
retrieving revision 1.28.6.1
retrieving revision 1.28.6.2
diff -C2 -d -r1.28.6.1 -r1.28.6.2
*** exceptions.c 3 Mar 2002 21:32:01 -0000 1.28.6.1
--- exceptions.c 23 Sep 2002 21:19:44 -0000 1.28.6.2
***************
*** 279,282 ****
--- 279,285 ----
break;
}
+ case -1:
+ PyErr_Clear();
+ /* Fall through */
default:
out = PyObject_Str(args);
***************
*** 410,413 ****
--- 413,419 ----
code = PySequence_GetItem(args, 0);
break;
+ case -1:
+ PyErr_Clear();
+ /* Fall through */
default:
Py_INCREF(args);
***************
*** 515,518 ****
--- 521,528 ----
goto finally;
}
+ break;
+
+ case -1:
+ PyErr_Clear();
break;
}