From 3adc065ddd0a596925b13db99b996ce8f5c26500 Mon Sep 17 00:00:00 2001 From: Jonah Jeleniewski Date: Thu, 9 Jan 2025 18:39:13 +1100 Subject: [PATCH] Fix protocol enum construction on Python 3.13+ On Python 3.13+, any protocol enum instance constructed from an int value would be treated like an unrecognized value. --- src/eolib/protocol/protocol_enum_meta.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/eolib/protocol/protocol_enum_meta.py b/src/eolib/protocol/protocol_enum_meta.py index 7dba2c8..a3a0e73 100644 --- a/src/eolib/protocol/protocol_enum_meta.py +++ b/src/eolib/protocol/protocol_enum_meta.py @@ -8,9 +8,7 @@ def __call__(cls, value, names=None, *, module=None, qualname=None, type=None, s value, names=names, module=module, qualname=qualname, type=type, start=start ) try: - return super().__call__( - value, names=names, module=module, qualname=qualname, type=type, start=start - ) + return super().__call__(value, module=module, qualname=qualname, type=type, start=start) except ValueError: unrecognized = int.__new__(cls, value) unrecognized._name_ = f"Unrecognized({int(value)})"