Skip to content

Commit b4b8261

Browse files
committed
StrEnum polyfill
1 parent ae9e557 commit b4b8261

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

python/python/async_tiff/enums.py

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

311
class Endianness(StrEnum):
412
"""

0 commit comments

Comments
 (0)