From 4cc30ae31341ba233a861899be7d225519c71830 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 11 Dec 2016 19:37:19 +0200 Subject: Issue #28739: f-string expressions no longer accepted as docstrings and by ast.literal_eval() even if they do not include subexpressions. --- Python/compile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Python/compile.c') diff --git a/Python/compile.c b/Python/compile.c index 35151cdd59..0e16075852 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; } -- cgit v1.2.1