aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 8b1eef79a79..8b9e2f02048 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -5042,8 +5042,12 @@ compiler_joined_str(struct compiler *c, expr_ty e)
}
else {
VISIT_SEQ(c, expr, e->v.JoinedStr.values);
- if (asdl_seq_LEN(e->v.JoinedStr.values) != 1) {
- ADDOP_I(c, loc, BUILD_STRING, asdl_seq_LEN(e->v.JoinedStr.values));
+ if (value_count > 1) {
+ ADDOP_I(c, loc, BUILD_STRING, value_count);
+ }
+ else if (value_count == 0) {
+ _Py_DECLARE_STR(empty, "");
+ ADDOP_LOAD_CONST_NEW(c, loc, Py_NewRef(&_Py_STR(empty)));
}
}
return SUCCESS;