10000 Avoid folding one node template into its content · python/cpython@0dda3f9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0dda3f9

Browse files
committed
Avoid folding one node template into its content
1 parent f742d45 commit 0dda3f9

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Python/codegen.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3864,13 +3864,7 @@ codegen_template_str(compiler *c, expr_ty e)
38643864
}
38653865
else {
38663866
VISIT_SEQ(c, expr, e->v.TemplateStr.values);
3867-
if (value_count > 1) {
3868-
ADDOP_I(c, loc, BUILD_TEMPLATE, value_count);
3869-
}
3870-
else if (value_count == 0) {
3871-
_Py_DECLARE_STR(empty, "");
3872-
ADDOP_LOAD_CONST_NEW(c, loc, Py_NewRef(&_Py_STR(empty)));
3873-
}
3867+
ADDOP_I(c, loc, BUILD_TEMPLATE, value_count);
38743868
}
38753869
return SUCCESS;
38763870
}

0 commit comments

Comments
 (0)
0