[Python-checkins] python/dist/src/Objects abstract.c,2.122,2.123

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Sun Jan 11 18:26:53 EST 2004


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1:/tmp/cvs-serv2999

Modified Files:
	abstract.c 
Log Message:
SF Patch #871704:  Py_SequenceFast can mask errors
(Contributed by Greg Chapman.)

Since this only changes the error message, I doubt that it should be
backported.



Index: abstract.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v
retrieving revision 2.122
retrieving revision 2.123
diff -C2 -d -r2.122 -r2.123
*** abstract.c	4 Jan 2004 11:00:08 -0000	2.122
--- abstract.c	11 Jan 2004 23:26:51 -0000	2.123
***************
*** 1497,1500 ****
--- 1497,1502 ----
  PySequence_Fast(PyObject *v, const char *m)
  {
+ 	PyObject *it;
+ 
  	if (v == NULL)
  		return null_error();
***************
*** 1505,1511 ****
  	}
  
! 	v = PySequence_Tuple(v);
! 	if (v == NULL && PyErr_ExceptionMatches(PyExc_TypeError))
! 		return type_error(m);
  
  	return v;
--- 1507,1519 ----
  	}
  
!  	it = PyObject_GetIter(v);
! 	if (it == NULL) {
! 		if (PyErr_ExceptionMatches(PyExc_TypeError))
! 			return type_error(m);
! 		return NULL;
! 	}
! 
! 	v = PySequence_Tuple(it);
! 	Py_DECREF(it);
  
  	return v;





More information about the Python-checkins mailing list