Skip to content

Commit

Permalink
trying to support python 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science committed Nov 1, 2024
1 parent 4342f9f commit 70b8186
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions armi/utils/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def __new__(cls, name, bases, attrs):

# Auto fields have been resolved, so now collect all ints
allFields = {name: val for name, val in attrs.items() if isinstance(val, int)}
allFields = {n: v for n, v in allFields.items() if not _FlagMeta.isdunder(n)}
flagClass._nameToValue = allFields
flagClass._valuesTaken = set(val for _, val in allFields.items())
flagClass._autoAt = autoAt
Expand All @@ -104,6 +105,10 @@ def __new__(cls, name, bases, attrs):

return flagClass

@staticmethod
def isdunder(s):
return s.startswith("__") and s.endswith("__")

def __getitem__(cls, key):
"""
Implement indexing at the class level.
Expand Down

0 comments on commit 70b8186

Please sign in to comment.