[Python-checkins] python/dist/src/Python symtable.c, 2.10.8.25,
2.10.8.26
jhylton at users.sourceforge.net
jhylton at users.sourceforge.net
Fri Apr 23 00:30:52 EDT 2004
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13787
Modified Files:
Tag: ast-branch
symtable.c
Log Message:
Report error for parameter clash with global statement
Index: symtable.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/symtable.c,v
retrieving revision 2.10.8.25
retrieving revision 2.10.8.26
diff -C2 -d -r2.10.8.25 -r2.10.8.26
*** symtable.c 13 Apr 2004 15:03:34 -0000 2.10.8.25
--- symtable.c 23 Apr 2004 04:30:50 -0000 2.10.8.26
***************
*** 328,333 ****
{
if (flags & DEF_GLOBAL) {
! if (flags & DEF_PARAM)
! return 0; /* can't declare a parameter as global */
SET_SCOPE(dict, name, GLOBAL_EXPLICIT);
if (PyDict_SetItem(global, name, Py_None) < 0)
--- 328,337 ----
{
if (flags & DEF_GLOBAL) {
! if (flags & DEF_PARAM) {
! return PyErr_Format(PyExc_SyntaxError,
! "name '%s' is local and global",
! PyString_AS_STRING(name));
! return 0;
! }
SET_SCOPE(dict, name, GLOBAL_EXPLICIT);
if (PyDict_SetItem(global, name, Py_None) < 0)
More information about the Python-checkins
mailing list