mirror of
https://github.com/python/cpython.git
synced 2026-05-06 12:49:07 -04:00
GH-130415: Narrow str to "" based on boolean tests (GH-130476)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user