summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-06-11 16:08:41 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-06-11 16:08:41 (GMT)
commite42109d79c3d06304e7364e7f60ea58b8b831412 (patch)
tree45b5e686c3f73cc0b19863971aa49702378f608c
parent4ddbdad8e75c4e8a413328f0fe00c0c07bc545fe (diff)
downloadcpython-e42109d79c3d06304e7364e7f60ea58b8b831412.zip
cpython-e42109d79c3d06304e7364e7f60ea58b8b831412.tar.gz
cpython-e42109d79c3d06304e7364e7f60ea58b8b831412.tar.bz2
Use PyErr_Format() directly instead of
PyOS_snprintf()+PyErr_SetString().
-rw-r--r--Python/symtable.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 1bb3c89..cc1a700 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -517,14 +517,12 @@ check_unoptimized(const PySTEntryObject* ste) {
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;