tzinfo.dst() must return a timedelta

Merged
#7 · Created  · Last updated

Merged pull request

Merged in joshfriend/aniso8601/tzinfo-dst-fix (pull request #7)

63929b4·Author: ·Closed by: ·2015-05-12

Description

The value of None is technically a valid return from tzinfo.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?

0 attachments

0 comments

Loading commits...