From bcdafbbb5fe944362be2737da97c906d5bb388ba Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Mon, 9 Oct 2023 19:06:07 +0100 Subject: [PATCH] fix python 3.8 compat again?!! --- riscemu/core/float.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/riscemu/core/float.py b/riscemu/core/float.py index b5170d9..56b6efa 100644 --- a/riscemu/core/float.py +++ b/riscemu/core/float.py @@ -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]) @@ -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: