mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-08-11 00:30:12 -04:00
enum.StrEnum was added in Python 3.11, but the documented minimum is 3.10. Add a compatibility shim in backend/app/core/compat.py that falls back to (str, Enum) on older versions. Updated all 5 import sites and lowered pyproject.toml target-version to py310.
11 lines
259 B
Python
11 lines
259 B
Python
"""Compatibility shims for older Python versions."""
|
|
|
|
import sys
|
|
|
|
if sys.version_info >= (3, 11):
|
|
from enum import StrEnum
|
|
else:
|
|
from enum import Enum
|
|
|
|
class StrEnum(str, Enum):
|
|
"""Drop-in replacement for enum.StrEnum on Python < 3.11."""
|