Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Black
  • Loading branch information
JukkaL committed Jun 18, 2023
commit 90cc72ac31b004b4eb251f8f8fff89534505a711
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