Skip to content

Commit

Permalink
fix python 3.8 compat again?!!
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLydike committed Oct 9, 2023
1 parent 31769c6 commit bcdafbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions riscemu/core/float.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(
):
if isinstance(val, (float, int)):
self._val = self._type(val)
elif isinstance(val, c_float | c_double):
elif isinstance(val, (c_float, c_double)):
self._val = self._type(val.value)
elif isinstance(val, (bytes, bytearray)):
self._val = self._type(struct.unpack("<" + self._struct_fmt_str, val)[0])
Expand Down Expand Up @@ -178,7 +178,7 @@ def bitcast(cls, f: "BaseFloat") -> "BaseFloat":
)

@classmethod
def flen_to_cls(cls, bits: int) -> type["BaseFloat"]:
def flen_to_cls(cls, bits: int) -> Type["BaseFloat"]:
if bits == 32:
return Float32
if bits == 64:
Expand Down

0 comments on commit bcdafbb

Please sign in to comment.