diff options
Diffstat (limited to 'rules/generate-options-symbols.py')
-rwxr-xr-x | rules/generate-options-symbols.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/rules/generate-options-symbols.py b/rules/generate-options-symbols.py index b29b9253..5eec9b7d 100755 --- a/rules/generate-options-symbols.py +++ b/rules/generate-options-symbols.py @@ -7,14 +7,20 @@ from __future__ import annotations import argparse -from enum import StrEnum, unique +from enum import unique import sys import xml.etree.ElementTree as ET - from typing import Generator, Iterable from dataclasses import dataclass from pathlib import Path +try: + # Available from Python 3.11 + from enum import StrEnum +except ImportError: + # Fallback to external package + from strenum import StrEnum + def error(msg): print(f"ERROR: {msg}", file=sys.stderr) |