timezone: Fix return type in get_timezone.

While it's true `datetime` is implicit via `pytz`, it makes sense
that mypy should now complain about the semantics of calling our
return type `pytz.datetime.tzinfo`, when such a type doesn't
actually exist.
This commit is contained in:
Wyatt Hoodes 2019-07-23 20:19:43 -10:00 committed by Tim Abbott
parent 55ad0d316a
commit 1c8106fc67
1 changed files with 2 additions and 1 deletions

View File

@ -2,9 +2,10 @@
from typing import List
import pytz
import datetime
def get_all_timezones() -> List[str]:
return sorted(pytz.all_timezones)
def get_timezone(tz: str) -> pytz.datetime.tzinfo:
def get_timezone(tz: str) -> datetime.tzinfo:
return pytz.timezone(tz)