From 3a1784a57516346e299e57c865399d6538df9e14 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 1 Dec 2022 00:00:33 +0100 Subject: Workaround for the problem in EnumLookupTable decorator. --- pyGHDL/libghdl/_decorator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyGHDL/libghdl/_decorator.py b/pyGHDL/libghdl/_decorator.py index 65a0473da..1648755c7 100644 --- a/pyGHDL/libghdl/_decorator.py +++ b/pyGHDL/libghdl/_decorator.py @@ -54,7 +54,7 @@ from pyGHDL.libghdl import libghdl, LibGHDLException @export def EnumLookupTable(cls) -> Callable: """ - Decorator to precalculate a enum lookup table (LUT) for enum position to + Decorator to precalculate an enum lookup table (LUT) for enum position to enum literal name. :param cls: Enumerator class for which a LUT shall be pre-calculated. @@ -62,7 +62,7 @@ def EnumLookupTable(cls) -> Callable: def decorator(func) -> Callable: def gen() -> List[str]: - d = [e for e in dir(cls) if e[0] != "_"] + d = [e for e in dir(cls) if e[0].isupper() and e[0] != "_"] res = [None] * len(d) for e in d: res[getattr(cls, e)] = e -- cgit v1.2.3