From 4672c788f59bdbb8385e3ae3cc66f54811855050 Mon Sep 17 00:00:00 2001 From: Adrien Berchet Date: Wed, 17 Apr 2024 20:59:13 +0200 Subject: [PATCH] Fix NeuriteType for Python 3.12.3 (#1116) * Fix NeuriteType for Python 3.12.3 * Coverage --- neurom/core/types.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/neurom/core/types.py b/neurom/core/types.py index e060ed2a..d5387460 100644 --- a/neurom/core/types.py +++ b/neurom/core/types.py @@ -81,8 +81,12 @@ def __call__(cls, value, names=None, *, module=None, qualname=None, type=None, s value = _int_or_tuple(value) except ValueError: pass + kwargs = {} + if names is not None: + # Keep default value of EnumMeta for Python>=3.12.3 + kwargs["names"] = names # pragma: no cover return super().__call__( - value, names=names, module=module, qualname=qualname, type=type, start=start + value, module=module, qualname=qualname, type=type, start=start, **kwargs )