diff options
author | Amit Lavon <amitlavon1.spam@gmail.com> | 2025-03-04 21:20:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-04 21:20:17 (GMT) |
commit | 691354ccb04f0e8f4faa864ee5003fc5efe8377e (patch) | |
tree | 95bb10a3d80b696905565f6c42c4d045793c1b8e /Python/optimizer_bytecodes.c | |
parent | b6769e9404646e38d9c786984ef308c8e9747b91 (diff) | |
download | cpython-691354ccb04f0e8f4faa864ee5003fc5efe8377e.zip cpython-691354ccb04f0e8f4faa864ee5003fc5efe8377e.tar.gz cpython-691354ccb04f0e8f4faa864ee5003fc5efe8377e.tar.bz2 |
GH-130415: Narrow str to "" based on boolean tests (GH-130476)
Diffstat (limited to 'Python/optimizer_bytecodes.c')
-rw-r--r-- | Python/optimizer_bytecodes.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c index 2aeed24..4bdef60 100644 --- a/Python/optimizer_bytecodes.c +++ b/Python/optimizer_bytecodes.c @@ -426,7 +426,7 @@ dummy_func(void) { op(_TO_BOOL_STR, (value -- res)) { if (!optimize_to_bool(this_instr, ctx, value, &res)) { - res = sym_new_type(ctx, &PyBool_Type); + res = sym_new_truthiness(ctx, value, true); sym_set_type(value, &PyUnicode_Type); } } |