diff Python/symtable.c @ 42801:41da49c97a59

Use unicode for error messages of duplicate args
author Neal Norwitz <nnorwitz@gmail.com>
date Fri, 24 Aug 2007 22:53:58 +0000
parents dd74e020a132
children 981ecc526703
line wrap: on
line diff
--- a/Python/symtable.c	Fri Aug 24 22:49:25 2007 +0000
+++ b/Python/symtable.c	Fri Aug 24 22:53:58 2007 +0000
@@ -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;