Kaydet (Commit) e42109d7 authored tarafından Walter Dörwald's avatar Walter Dörwald

Use PyErr_Format() directly instead of

PyOS_snprintf()+PyErr_SetString().
üst 4ddbdad8
...@@ -517,14 +517,12 @@ check_unoptimized(const PySTEntryObject* ste) { ...@@ -517,14 +517,12 @@ check_unoptimized(const PySTEntryObject* ste) {
case OPT_TOPLEVEL: /* import * at top-level is fine */ case OPT_TOPLEVEL: /* import * at top-level is fine */
return 1; return 1;
case OPT_IMPORT_STAR: case OPT_IMPORT_STAR:
PyOS_snprintf(buf, sizeof(buf), PyErr_Format("import * is not allowed in function '%U' "
"import * is not allowed in function '%U' " "because it %s",
"because it %s", ste->ste_name, trailer);
ste->ste_name, trailer);
break; break;
} }
PyErr_SetString(PyExc_SyntaxError, buf);
PyErr_SyntaxLocation(ste->ste_table->st_filename, PyErr_SyntaxLocation(ste->ste_table->st_filename,
ste->ste_opt_lineno); ste->ste_opt_lineno);
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment