1
0
mirror of https://github.com/polakowo/vectorbt.git synced 2022-03-22 01:31:39 +03:00

Merge branch 'master' of github.com:polakowo/vectorbt

This commit is contained in:
Oleg Polakow
2022-03-17 18:54:36 +01:00

View File

@@ -100,7 +100,7 @@ def to_timezone(tz: tp.TimezoneLike, to_py_timezone: tp.Optional[bool] = None, *
if isinstance(tz, timedelta):
tz = timezone(tz)
if isinstance(tz, tzinfo):
if to_py_timezone or tz != copy.copy(tz):
if to_py_timezone:
return timezone(tz.utcoffset(datetime.now()))
return tz
raise TypeError("Couldn't parse the timezone")