Mercurial > cpython-lru_cache-weakref
diff Python/symtable.c @ 42044:faa626d6e675
Use PyErr_Format() directly instead of
PyOS_snprintf()+PyErr_SetString().
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Mon, 11 Jun 2007 16:08:41 +0000 |
| parents | 61fd5444d95f |
| children | 171f0e073671 |
line wrap: on
line diff
--- a/Python/symtable.c Mon Jun 11 16:06:26 2007 +0000 +++ b/Python/symtable.c Mon Jun 11 16:08:41 2007 +0000 @@ -517,14 +517,12 @@ case OPT_TOPLEVEL: /* import * at top-level is fine */ return 1; case OPT_IMPORT_STAR: - PyOS_snprintf(buf, sizeof(buf), - "import * is not allowed in function '%U' " - "because it %s", - ste->ste_name, trailer); + PyErr_Format("import * is not allowed in function '%U' " + "because it %s", + ste->ste_name, trailer); break; } - PyErr_SetString(PyExc_SyntaxError, buf); PyErr_SyntaxLocation(ste->ste_table->st_filename, ste->ste_opt_lineno); return 0;
