tzinfo.dst() must return a timedelta
Josh Friend
Branch: joshfriend/aniso8601:tzinfo-dst-fix
Branch: nielsenb/aniso8601:master
Merged
Merged pull request
Merged in joshfriend/aniso8601/tzinfo-dst-fix (pull request #7)
Merged in joshfriend/aniso8601/tzinfo-dst-fix (pull request #7)
The value of
None
is technically a valid return fromtzinfo.dst()
, but this doesn't work nicely in the following scenario:>>> tz = parse_timezone('+04:00') >>> datetime.now(tz) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: fromutc: non-None dst() result required
Is returning a
timedelta
with a value of 0 technically the same thing?