[Python-3000-checkins] r57425 - python/branches/py3k/Python/symtable.c

neal.norwitz python-3000-checkins at python.org
Sat Aug 25 00:53:58 CEST 2007


Author: neal.norwitz
Date: Sat Aug 25 00:53:58 2007
New Revision: 57425

Modified:
   python/branches/py3k/Python/symtable.c
Log:
Use unicode for error messages of duplicate args

Modified: python/branches/py3k/Python/symtable.c
==============================================================================
--- python/branches/py3k/Python/symtable.c	(original)
+++ python/branches/py3k/Python/symtable.c	Sat Aug 25 00:53:58 2007
@@ -189,7 +189,7 @@
 	((VAR) ? (VAR) : ((VAR) = PyUnicode_InternFromString(# VAR)))
 
 #define DUPLICATE_ARGUMENT \
-"duplicate argument '%s' in function definition"
+"duplicate argument '%U' in function definition"
 
 static struct symtable *
 symtable_new(void)
@@ -868,8 +868,7 @@
 	    val = PyInt_AS_LONG(o);
 	    if ((flag & DEF_PARAM) && (val & DEF_PARAM)) {
 		    /* Is it better to use 'mangled' or 'name' here? */
-		    PyErr_Format(PyExc_SyntaxError, DUPLICATE_ARGUMENT,
-				 PyString_AsString(name));
+		    PyErr_Format(PyExc_SyntaxError, DUPLICATE_ARGUMENT, name);
 		    PyErr_SyntaxLocation(st->st_filename,
 				       st->st_cur->ste_lineno);
 		    goto error;


More information about the Python-3000-checkins mailing list