diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-11 19:39:36 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-11 19:39:36 +0200 |
commit | 0f6373c34f5c0881d6ab2329aea5bce742789b20 (patch) | |
tree | 67470506d05cf6bff1d25067fc7068084a601a65 /Python/compile.c | |
parent | 26817a84908b831d71dd59de432f75829a5bae33 (diff) | |
parent | 4cc30ae31341ba233a861899be7d225519c71830 (diff) | |
download | cpython-git-0f6373c34f5c0881d6ab2329aea5bce742789b20.tar.gz |
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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c index 76f08da432..f4edf8fd88 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -3412,7 +3412,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; } |