Skip to content

Commit

Permalink
Use EnumMeta instead of EnumType for Python <3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
injust committed Jan 9, 2025
1 parent 3be7e85 commit c13a3df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/apscheduler/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from collections.abc import Callable
from datetime import date, datetime, timedelta, timezone, tzinfo
from enum import EnumType
from enum import EnumMeta
from typing import TypeVar
from uuid import UUID
from zoneinfo import ZoneInfo
Expand Down Expand Up @@ -64,8 +64,8 @@ def as_timedelta(value: timedelta | int) -> timedelta:
return value


def as_enum(enum_class: EnumType) -> Callable[[EnumType | str], EnumType]:
def converter(value: EnumType | str) -> EnumType:
def as_enum(enum_class: EnumMeta) -> Callable[[EnumMeta | str], EnumMeta]:
def converter(value: EnumMeta | str) -> EnumMeta:
if isinstance(value, str):
return enum_class.__members__[value]

Expand Down

0 comments on commit c13a3df

Please sign in to comment.