summaryrefslogtreecommitdiff
path: root/babel/localtime/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'babel/localtime/__init__.py')
-rw-r--r--babel/localtime/__init__.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/babel/localtime/__init__.py b/babel/localtime/__init__.py
index ffe2d49..c7f214a 100644
--- a/babel/localtime/__init__.py
+++ b/babel/localtime/__init__.py
@@ -14,8 +14,6 @@ import time
from datetime import datetime, timedelta, tzinfo
from threading import RLock
-import pytz
-
if sys.platform == 'win32':
from babel.localtime._win32 import _get_localzone
else:
@@ -61,7 +59,7 @@ class _FallbackLocalTimezone(tzinfo):
return tt.tm_isdst > 0
-def get_localzone() -> pytz.BaseTzInfo:
+def get_localzone() -> tzinfo:
"""Returns the current underlying local timezone object.
Generally this function does not need to be used, it's a
better idea to use the :data:`LOCALTZ` singleton instead.
@@ -71,5 +69,5 @@ def get_localzone() -> pytz.BaseTzInfo:
try:
LOCALTZ = get_localzone()
-except pytz.UnknownTimeZoneError:
+except LookupError:
LOCALTZ = _FallbackLocalTimezone()