Skip to content

Commit

Permalink
Black
Browse files Browse the repository at this point in the history
  • Loading branch information
JukkaL committed Jun 18, 2023
1 parent 8cf1a92 commit 90cc72a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions mypyc/codegen/emit.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,11 +929,7 @@ def emit_unbox(
self.emit_line("double {};".format(dest))
# TODO: Don't use __float__ and __index__
self.emit_line(f"{dest} = PyFloat_AsDouble({src});")
self.emit_lines(
f"if ({dest} == -1.0 && PyErr_Occurred()) {{",
failure,
"}"
)
self.emit_lines(f"if ({dest} == -1.0 && PyErr_Occurred()) {{", failure, "}")
elif isinstance(typ, RTuple):
self.declare_tuple_struct(typ)
if declare_dest:
Expand Down Expand Up @@ -1150,7 +1146,8 @@ def _emit_traceback(
self.emit_line('assert(PyErr_Occurred() != NULL && "failure w/o err!");')

def emit_unbox_failure_with_overlapping_error_value(
self, dest: str, typ: RType, failure: str) -> None:
self, dest: str, typ: RType, failure: str
) -> None:
self.emit_line(f"if ({dest} == {self.c_error_value(typ)} && PyErr_Occurred()) {{")
self.emit_line(failure)
self.emit_line("}")
Expand Down

0 comments on commit 90cc72a

Please sign in to comment.