aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2022-12-01 00:00:33 +0100
committerPatrick Lehmann <Patrick.Lehmann@plc2.de>2022-12-01 00:00:33 +0100
commit3a1784a57516346e299e57c865399d6538df9e14 (patch)
tree68c5d770ae4d35ba4562aafbcdef6ca263729533
parent30a8c57439520e6f043b5aaa5fde9ea5ca38e490 (diff)
downloadghdl-3a1784a57516346e299e57c865399d6538df9e14.tar.gz
ghdl-3a1784a57516346e299e57c865399d6538df9e14.tar.bz2
ghdl-3a1784a57516346e299e57c865399d6538df9e14.zip
Workaround for the problem in EnumLookupTable decorator.
-rw-r--r--pyGHDL/libghdl/_decorator.py4
1 files 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