Use unicode for error messages of duplicate args
authorNeal Norwitz <nnorwitz@gmail.com>
Fri, 24 Aug 2007 22:53:58 +0000 (22:53 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Fri, 24 Aug 2007 22:53:58 +0000 (22:53 +0000)
Python/symtable.c

index 47fdad22f1e3dd80804c675ffba54c3d3c57b38d..59eef02c74781ad124de67eaf38f5ea2542039d5 100644 (file)
@@ -189,7 +189,7 @@ static identifier top = NULL, lambda = NULL, genexpr = NULL,
        ((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 @@ symtable_add_def(struct symtable *st, PyObject *name, int flag)
            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;