Skip to content

Commit 10103f8

Browse files
committed
Support tzlocal>=3.0 #166
1 parent d6b263e commit 10103f8

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

clickhouse_driver/columns/datetimecolumn.py

+2
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ def create_datetime_column(spec, column_options):
194194
else:
195195
if not context.settings.get('use_client_time_zone', False):
196196
try:
197+
local_timezone = get_localzone().key
198+
except AttributeError:
197199
local_timezone = get_localzone().zone
198200
except Exception:
199201
local_timezone = None

clickhouse_driver/columns/numpy/datetimecolumn.py

+2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ def create_numpy_datetime_column(spec, column_options):
125125
# As Numpy do not use local timezone for converting timestamp to
126126
# datetime we need always detect local timezone for manual converting.
127127
try:
128+
local_timezone = get_localzone().key
129+
except AttributeError:
128130
local_timezone = get_localzone().zone
129131
except Exception:
130132
pass

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def read_version():
133133
python_requires='>=3.4.*, <4',
134134
install_requires=[
135135
'pytz',
136-
'tzlocal<3.0'
136+
'tzlocal'
137137
],
138138
ext_modules=extensions,
139139
extras_require={

0 commit comments

Comments
 (0)