Skip to content

Commit

Permalink
fix python 3.8 typings
Browse files Browse the repository at this point in the history
  • Loading branch information
devkral committed Aug 1, 2024
1 parent 5b94ba1 commit 9b99c67
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions asyncz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ def to_timezone(value: Any) -> Optional[tzinfo]:
Converts a value to timezone object.
"""
if isinstance(value, str):
return ZoneInfo(value)
# python 3.8 typing issue
return cast(tzinfo, ZoneInfo(value))
if isinstance(value, tzinfo):
return value
if value is not None:
Expand Down Expand Up @@ -164,7 +165,8 @@ def to_datetime(
)

if isinstance(tz, str):
tz = ZoneInfo(tz)
# python 3.8 typing issue
tz = cast(tzinfo, ZoneInfo(tz))

return localize(_datetime, tz)

Expand Down

0 comments on commit 9b99c67

Please sign in to comment.