[Python-checkins] python/dist/src/Objects typeobject.c,2.162,2.163
jhylton@users.sourceforge.net
jhylton@users.sourceforge.net
Thu, 25 Jul 2002 09:43:32 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv12096
Modified Files:
typeobject.c
Log Message:
Don't be so hasty. If PyInt_AsLong() raises an error, don't set ValueError.
Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.162
retrieving revision 2.163
diff -C2 -d -r2.162 -r2.163
*** typeobject.c 25 Jul 2002 16:06:15 -0000 2.162
--- typeobject.c 25 Jul 2002 16:43:29 -0000 2.163
***************
*** 2973,2976 ****
--- 2973,2978 ----
len = (int)PyInt_AsLong(res);
Py_DECREF(res);
+ if (len == -1 && PyErr_Occurred())
+ return -1;
if (len < 0) {
PyErr_SetString(PyExc_ValueError,