[Python-checkins] CVS: python/dist/src/Python future.c,2.2,2.3

Jeremy Hylton jhylton@users.sourceforge.net
Tue, 27 Feb 2001 18:26:16 -0800


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

Modified Files:
	future.c 
Log Message:
Need to support single_input explicitly so from __future__ imports
are legal at the interactive interpreter prompt.  They don't do
anything yet...


Index: future.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/future.c,v
retrieving revision 2.2
retrieving revision 2.3
diff -C2 -r2.2 -r2.3
*** future.c	2001/02/28 01:58:08	2.2
--- future.c	2001/02/28 02:26:14	2.3
***************
*** 72,75 ****
--- 72,82 ----
  	switch (TYPE(n)) {
  
+ 	case single_input:
+ 		if (TYPE(CHILD(n, 0)) == simple_stmt) {
+ 			n = CHILD(n, 0);
+ 			goto loop;
+ 		}
+ 		return 0;
+ 
  	case file_input:
  		for (i = 0; i < NCH(n); i++) {
***************
*** 158,161 ****
--- 165,169 ----
  		if (future_check_features(ff, n) < 0)
  			return -1;
+ 		ff->ff_last_lineno = n->n_lineno + 1;
  		return 1;
  	}