[Python-checkins] python/dist/src/Python compile.c,2.308,2.309

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Sat Jul 17 23:46:27 CEST 2004


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv414/Python

Modified Files:
	compile.c 
Log Message:
Upgrade None assignment SyntaxWarning to a SyntaxError.

Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.308
retrieving revision 2.309
diff -C2 -d -r2.308 -r2.309
*** compile.c	17 Jul 2004 05:00:52 -0000	2.308
--- compile.c	17 Jul 2004 21:46:24 -0000	2.309
***************
*** 1228,1235 ****
  		else
  			msg = "deleting None";
! 		if (issue_warning(msg, c->c_filename, c->c_lineno) < 0) {
! 			c->c_errors++;
! 			return -1;
! 		}
  	}
  	return 0;
--- 1228,1233 ----
  		else
  			msg = "deleting None";
! 		com_error(c, PyExc_SyntaxError, msg);
! 		return -1;
  	}
  	return 0;
***************
*** 1248,1252 ****
  	    none_assignment_check(c, name, kind == VAR_STORE))
  	{
- 		c->c_errors++;
  		i = 255;
  		goto done;
--- 1246,1249 ----
***************
*** 5484,5489 ****
  	    *name == 'N' && strcmp(name, "None") == 0)
  	{
! 		if (symtable_warn(st, "argument named None"))
! 			return -1;
  	}
  	if (_Py_Mangle(st->st_private, name, buffer, sizeof(buffer)))
--- 5481,5488 ----
  	    *name == 'N' && strcmp(name, "None") == 0)
  	{
! 		PyErr_SetString(PyExc_SyntaxError, 
! 			"Invalid syntax.  Assignment to None.");
! 		symtable_error(st, 0);
! 		return  -1;
  	}
  	if (_Py_Mangle(st->st_private, name, buffer, sizeof(buffer)))



More information about the Python-checkins mailing list