[Python-checkins] CVS: python/dist/src/Python ceval.c,2.230.2.1,2.230.2.2

Guido van Rossum gvanrossum@usw-pr-cvs1.sourceforge.net
Tue, 13 Mar 2001 05:48:23 -0800


Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv20878/Python

Modified Files:
      Tag: iter-branch
	ceval.c 
Log Message:
Switch to using it.next() instead of it() to get the next value.


Index: ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.230.2.1
retrieving revision 2.230.2.2
diff -C2 -r2.230.2.1 -r2.230.2.2
*** ceval.c	2001/03/13 10:07:42	2.230.2.1
--- ceval.c	2001/03/13 13:48:21	2.230.2.2
***************
*** 377,380 ****
--- 377,381 ----
  	char *filename = PyString_AsString(co->co_filename);
  #endif
+ 	static PyObject *nextstr;
  
  /* Code access macros */
***************
*** 412,415 ****
--- 413,421 ----
  
  /* Start of code */
+ 	if (nextstr == NULL) {
+ 		nextstr = PyString_InternFromString("next");
+ 		if (nextstr == NULL)
+ 			return NULL;
+ 	}
  
  #ifdef USE_STACKCHECK
***************
*** 1829,1834 ****
  			Py_DECREF(v);
  			if (x != NULL) {
! 				PUSH(x);
! 				continue;
  			}
  			break;
--- 1835,1845 ----
  			Py_DECREF(v);
  			if (x != NULL) {
! 				w = x;
! 				x = PyObject_GetAttr(w, nextstr);
! 				Py_DECREF(w);
! 				if (x != NULL) {
! 					PUSH(x);
! 					continue;
! 				}
  			}
  			break;