Skip to content
Closed
Prev Previous commit
Next Next commit
Start calling tag(*args)
  • Loading branch information
gvanrossum committed May 3, 2022
commit 67175b0b35428ba91d9f2b3c1747d2ec42b39b09
9 changes: 2 additions & 7 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -4916,19 +4916,14 @@ compiler_tag_string(struct compiler *c, expr_ty e)
expr_ty str = e->v.TagString.str;
if (tag->kind == Name_kind) {
if (str->kind == JoinedStr_kind) {
// Generate code for tag(str)
asdl_expr_seq *args =
_Py_asdl_expr_seq_new(1, c->c_arena);
if (args == NULL)
return 0;
asdl_seq_SET(args, 0, str);
// Generate code for tag(str1, str2, ...)
asdl_keyword_seq *keywords =
_Py_asdl_keyword_seq_new(0, c->c_arena);
if (keywords == NULL)
return 0;
ADDOP(c, PUSH_NULL);
VISIT(c, expr, tag);
return compiler_call_helper(c, 0, args, keywords);
return compiler_call_helper(c, 0, str->v.JoinedStr.values, keywords);
}
}
}
Expand Down