Skip to content

Commit a4094d0

Browse files
committed
Convert ternary to if statement as mypyc bug workaround
See mypyc#1109
1 parent 617d952 commit a4094d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mypyc/ir/func_ir.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,9 @@ def _extract_python_literal(value: Value) -> object:
458458
if is_none_rprimitive(value.type):
459459
return None
460460
val = value.numeric_value()
461-
return bool(val) if is_bool_rprimitive(value.type) else val
461+
if is_bool_rprimitive(value.type):
462+
return bool(val)
463+
return val
462464
elif isinstance(value, Float):
463465
return value.value
464466
elif isinstance(value, LoadLiteral):

0 commit comments

Comments
 (0)