Skip to content

Commit 8dd46b5

Browse files
committed
🐛 fix: fixed enum type for python 310
1 parent cf78a51 commit 8dd46b5

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

hackagent/datasets/intents.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,20 @@
1111

1212
import json
1313
import re
14-
from enum import StrEnum
14+
from enum import Enum
1515
from functools import lru_cache
1616
from pathlib import Path
1717
from typing import Any, Dict, List, Mapping, Sequence, Tuple
1818

19+
try:
20+
from enum import StrEnum
21+
except ImportError: # Python < 3.11
22+
23+
class StrEnum(str, Enum):
24+
"""Minimal StrEnum fallback for Python 3.10 compatibility."""
25+
26+
pass
27+
1928

2029
_OMNISAFEBENCH_DATASET_PATH = (
2130
Path(__file__).resolve().parent / "omnisafebench" / "dataset.json"

0 commit comments

Comments
 (0)