diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-11 17:37:19 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-11 17:37:19 (GMT) |
commit | 4cc30ae31341ba233a861899be7d225519c71830 (patch) | |
tree | 0743a75a586d301a15f37355a567488eee239618 /Python/compile.c | |
parent | 8114f21668fe9775d2542d079c6396a745f4f094 (diff) | |
download | cpython-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.c | 3 |
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; } |