[Python-checkins] python/dist/src/Python compile.c,2.244,2.245

jhylton@users.sourceforge.net jhylton@users.sourceforge.net
Fri, 31 May 2002 07:08:31 -0700


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

Modified Files:
	compile.c 
Log Message:
Fix SF bug [ 561825 ] Confusing error for "del f()"

In the error message, say del for del and assign for everything else.


Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.244
retrieving revision 2.245
diff -C2 -d -r2.244 -r2.245
*** compile.c	28 May 2002 18:47:29 -0000	2.244
--- compile.c	31 May 2002 14:08:29 -0000	2.245
***************
*** 2418,2423 ****
  	switch (TYPE(CHILD(n, 0))) {
  	case LPAR: /* '(' [exprlist] ')' */
! 		com_error(c, PyExc_SyntaxError,
! 			  "can't assign to function call");
  		break;
  	case DOT: /* '.' NAME */
--- 2418,2427 ----
  	switch (TYPE(CHILD(n, 0))) {
  	case LPAR: /* '(' [exprlist] ')' */
! 		if (assigning == OP_DELETE)
! 			com_error(c, PyExc_SyntaxError,
! 				  "can't delete function call");
! 		else
! 			com_error(c, PyExc_SyntaxError,
! 				  "can't assign to function call");
  		break;
  	case DOT: /* '.' NAME */