summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-12-11 17:37:19 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-12-11 17:37:19 (GMT)
commit4cc30ae31341ba233a861899be7d225519c71830 (patch)
tree0743a75a586d301a15f37355a567488eee239618 /Python/compile.c
parent8114f21668fe9775d2542d079c6396a745f4f094 (diff)
downloadcpython-4cc30ae31341ba233a861899be7d225519c71830.zip
cpython-4cc30ae31341ba233a861899be7d225519c71830.tar.gz
cpython-4cc30ae31341ba233a861899be7d225519c71830.tar.bz2
Issue #28739: f-string expressions no longer accepted as docstrings and
by ast.literal_eval() even if they do not include subexpressions.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 35151cd..0e16075 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -3415,7 +3415,8 @@ static int
compiler_joined_str(struct compiler *c, expr_ty e)
{
VISIT_SEQ(c, expr, e->v.JoinedStr.values);
- ADDOP_I(c, BUILD_STRING, asdl_seq_LEN(e->v.JoinedStr.values));
+ if (asdl_seq_LEN(e->v.JoinedStr.values) != 1)
+ ADDOP_I(c, BUILD_STRING, asdl_seq_LEN(e->v.JoinedStr.values));
return 1;
}