cbor2: Improve decoder to pass Ruff F821 undefined-name.

These were probably intentional missing names, however raising
NotImplementedError or KeyError is more explicit than trying to call an
unknown function.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
pull/714/head
Angus Gratton 2023-08-09 18:53:18 +10:00 zatwierdzone przez Damien George
rodzic 786c0ea895
commit c6a72c70b9
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -160,7 +160,7 @@ def decode_simple_value(decoder):
def decode_float16(decoder):
payload = decoder.read(2)
return unpack_float16(payload)
raise NotImplementedError # no float16 unpack function
def decode_float32(decoder):
@ -185,7 +185,7 @@ special_decoders = {
20: lambda self: False,
21: lambda self: True,
22: lambda self: None,
23: lambda self: undefined,
# 23 is undefined
24: decode_simple_value,
25: decode_float16,
26: decode_float32,