[Python-checkins] CVS: python/dist/src/Python compile.c,2.189,2.190

Jeremy Hylton jhylton@users.sourceforge.net
Wed, 21 Mar 2001 11:01:36 -0800


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

Modified Files:
	compile.c 
Log Message:
Update PyNode_CompileSymtable() to understand future statements


Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.189
retrieving revision 2.190
diff -C2 -r2.189 -r2.190
*** compile.c	2001/03/21 16:43:47	2.189
--- compile.c	2001/03/21 19:01:33	2.190
***************
*** 3781,3800 ****
  {
  	struct symtable *st;
  
  	st = symtable_init();
  	if (st == NULL)
  		return NULL;
! 	assert(st->st_symbols != NULL);
  	symtable_enter_scope(st, TOP, TYPE(n), n->n_lineno);
! 	if (st->st_errors > 0) {
! 		PySymtable_Free(st);
! 		return NULL;
! 	}
  	symtable_node(st, n);
! 	if (st->st_errors > 0) {
! 		PySymtable_Free(st);
! 		return NULL;
! 	}
  	return st;
  }
  
--- 3781,3806 ----
  {
  	struct symtable *st;
+ 	PyFutureFeatures *ff;
  
+ 	ff = PyNode_Future(n, filename);
+ 	if (ff == NULL)
+ 		return NULL;
  	st = symtable_init();
  	if (st == NULL)
  		return NULL;
! 	st->st_future = ff;
  	symtable_enter_scope(st, TOP, TYPE(n), n->n_lineno);
! 	if (st->st_errors > 0)
! 		goto fail;
  	symtable_node(st, n);
! 	if (st->st_errors > 0)
! 		goto fail;
! 
  	return st;
+  fail:
+ 	PyMem_Free((void *)ff);
+ 	st->st_future = NULL;
+ 	PySymtable_Free(st);
+ 	return NULL;
  }