Skip to content

Commit ebb4e2d

Browse files
committed
StrEnum polyfill
1 parent ae9e557 commit ebb4e2d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

python/python/async_tiff/enums.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
from enum import IntEnum, StrEnum
1+
import sys
2+
from enum import Enum
3+
4+
# Define a backport of StrEnum if needed
5+
if sys.version_info >= (3, 11):
6+
from enum import StrEnum
7+
else:
8+
class StrEnum(str, Enum):
9+
def __str__(self):
10+
return str(self.value)
211

312
class Endianness(StrEnum):
413
"""

0 commit comments

Comments
 (0)