Skip to content

Commit 7b17521

Browse files
committed
Fix a mypy warning
1 parent 2908482 commit 7b17521

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mypyc/irbuild/ll_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,8 +1597,8 @@ def unary_op(self, value: Value, expr_op: str, line: int) -> Value:
15971597
return Float(-value.value, value.line)
15981598
if isinstance(typ, RInstance):
15991599
result = self.dunder_op(value, None, expr_op, line)
1600-
assert result, "Unsupported unary operation: %s" % expr_op
1601-
return result
1600+
if result is not None:
1601+
return result
16021602
call_c_ops_candidates = unary_ops.get(expr_op, [])
16031603
target = self.matching_call_c(call_c_ops_candidates, [value], line)
16041604
assert target, "Unsupported unary operation: %s" % expr_op

0 commit comments

Comments
 (0)