fix: add workaround for same value in Steps IntEnum

(cherry picked from commit ea1562d078)
This commit is contained in:
Manuel Schmid
2024-06-16 18:41:17 +02:00
parent e279d032ef
commit af209cda53
2 changed files with 7 additions and 2 deletions
+3 -2
View File
@@ -119,8 +119,9 @@ def get_steps(key: str, fallback: str | None, source_dict: dict, results: list,
assert h is not None
h = int(h)
# if not in steps or in steps and performance is not the same
if h not in iter(Steps) or Steps(h).name.casefold() != source_dict.get('performance', '').replace(' ',
'_').casefold():
performance_name = source_dict.get('performance', '').replace(' ', '_').replace('-', '_').casefold()
performance_candidates = [key for key in Steps.keys() if key.casefold() == performance_name and Steps[key] == h]
if len(performance_candidates) == 0:
results.append(h)
return
results.append(-1)