[Python-3000-checkins] r55899 - python/branches/py3k-struni/Python/symtable.c
walter.doerwald
python-3000-checkins at python.org
Mon Jun 11 18:08:46 CEST 2007
Author: walter.doerwald
Date: Mon Jun 11 18:08:41 2007
New Revision: 55899
Modified:
python/branches/py3k-struni/Python/symtable.c
Log:
Use PyErr_Format() directly instead of
PyOS_snprintf()+PyErr_SetString().
Modified: python/branches/py3k-struni/Python/symtable.c
==============================================================================
--- python/branches/py3k-struni/Python/symtable.c (original)
+++ python/branches/py3k-struni/Python/symtable.c Mon Jun 11 18:08:41 2007
@@ -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;
More information about the Python-3000-checkins
mailing list