summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorEric V. Smith <ericvsmith@users.noreply.github.com>2019-05-27 15:31:52 -0400
committerGitHub <noreply@github.com>2019-05-27 15:31:52 -0400
commit6f6ff8a56518a80da406aad6ac8364c046cc7f18 (patch)
tree645d87649541f53b0ea4180a5f886c84320453fa /Python/compile.c
parent695b1dd8cbf3a48fdb30ab96918a49b20b7ec3e7 (diff)
downloadcpython-git-6f6ff8a56518a80da406aad6ac8364c046cc7f18.tar.gz
bpo-37050: Remove expr_text from FormattedValue ast node, use Constant node instead (GH-13597)
When using the "=" debug functionality of f-strings, use another Constant node (or a merged constant node) instead of adding expr_text to the FormattedValue node.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 425d0d68ac..f1c97bdfe4 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -3963,12 +3963,6 @@ compiler_formatted_value(struct compiler *c, expr_ty e)
int conversion = e->v.FormattedValue.conversion;
int oparg;
- if (e->v.FormattedValue.expr_text) {
- /* Push the text of the expression (which already has the '=' in
- it. */
- ADDOP_LOAD_CONST(c, e->v.FormattedValue.expr_text);
- }
-
/* The expression to be formatted. */
VISIT(c, expr, e->v.FormattedValue.value);
@@ -3991,11 +3985,6 @@ compiler_formatted_value(struct compiler *c, expr_ty e)
/* And push our opcode and oparg */
ADDOP_I(c, FORMAT_VALUE, oparg);
- /* If we have expr_text, join the 2 strings on the stack. */
- if (e->v.FormattedValue.expr_text) {
- ADDOP_I(c, BUILD_STRING, 2);
- }
-
return 1;
}