Use unicode for error messages of duplicate args
This commit is contained in:
parent
808c7d86ea
commit
a5d16a3f85
|
@ -189,7 +189,7 @@ static identifier top = NULL, lambda = NULL, genexpr = NULL,
|
||||||
((VAR) ? (VAR) : ((VAR) = PyUnicode_InternFromString(# VAR)))
|
((VAR) ? (VAR) : ((VAR) = PyUnicode_InternFromString(# VAR)))
|
||||||
|
|
||||||
#define DUPLICATE_ARGUMENT \
|
#define DUPLICATE_ARGUMENT \
|
||||||
"duplicate argument '%s' in function definition"
|
"duplicate argument '%U' in function definition"
|
||||||
|
|
||||||
static struct symtable *
|
static struct symtable *
|
||||||
symtable_new(void)
|
symtable_new(void)
|
||||||
|
@ -868,8 +868,7 @@ symtable_add_def(struct symtable *st, PyObject *name, int flag)
|
||||||
val = PyInt_AS_LONG(o);
|
val = PyInt_AS_LONG(o);
|
||||||
if ((flag & DEF_PARAM) && (val & DEF_PARAM)) {
|
if ((flag & DEF_PARAM) && (val & DEF_PARAM)) {
|
||||||
/* Is it better to use 'mangled' or 'name' here? */
|
/* Is it better to use 'mangled' or 'name' here? */
|
||||||
PyErr_Format(PyExc_SyntaxError, DUPLICATE_ARGUMENT,
|
PyErr_Format(PyExc_SyntaxError, DUPLICATE_ARGUMENT, name);
|
||||||
PyString_AsString(name));
|
|
||||||
PyErr_SyntaxLocation(st->st_filename,
|
PyErr_SyntaxLocation(st->st_filename,
|
||||||
st->st_cur->ste_lineno);
|
st->st_cur->ste_lineno);
|
||||||
goto error;
|
goto error;
|
||||||
|
|
Loading…
Reference in New Issue