Skip to content

Commit cfdba83

Browse files
author
Val Brodsky
committed
Fix to deal with StrEnum in python 3.8
We can remove this once we stop supporting 3.8
1 parent 88f81cc commit cfdba83

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

labelbox/schema/id_type.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
from strenum import StrEnum
1+
import sys
22

3+
if sys.version_info > (3, 8):
4+
from strenum import StrEnum
35

4-
class IdType(StrEnum):
6+
class BaseStrEnum(StrEnum):
7+
pass
8+
else:
9+
from enum import Enum
10+
11+
class BaseStrEnum(str, Enum):
12+
pass
13+
14+
15+
class IdType(BaseStrEnum):
516
"""
617
The type of id used to identify a data row.
718

0 commit comments

Comments
 (0)