[Python-Dev] compile.c: problem with duplicate argument bugfix

Guido van Rossum guido@beopen.com
Sat, 08 Jul 2000 18:34:02 -0500


> diff -c -d -T --recursive python/dist/src/Python/compile.c python-mod/dist/src/Python/compile.c
> *** python/dist/src/Python/compile.c	Mon Jul  3 21:39:47 2000
> --- python-mod/dist/src/Python/compile.c	Sat Jul  8 19:13:42 2000
> ***************
> *** 3102,3109 ****
>  				name = nbuf;
>  				sprintf(nbuf, ".%d", i);
>  				complex = 1;
>  			}
> !			com_newlocal(c, name);
>  			c->c_argcount++;
>  			if (++i >= nch)
>  				break;
> --- 3103,3120 ----
>  				name = nbuf;
>  				sprintf(nbuf, ".%d", i);
>  				complex = 1;
> +	                }
> +	                
> +			nameval = PyString_InternFromString(name);
> +			if (nameval == NULL) {
> +				c->c_errors++;
>  			}
> !			if (PyDict_GetItem(c->c_locals, nameval)) {
> !				com_error(c, PyExc_SyntaxError,"double identifier in function definition");
> !			}
> !			com_newlocal_o(c, nameval);
> !			Py_DECREF(nameval);
> !	                
>  			c->c_argcount++;
>  			if (++i >= nch)
>  				break;
> 

I get a compile error: nameval undeclared.  Which version are you
working off?  Please use the SourceForge CVS tree!

--Guido van Rossum (home page: http://dinsdale.python.org/~guido/)