Skip to content

Commit

Permalink
Workaround for a weird bug with newer versions of pytz, which fails w…
Browse files Browse the repository at this point in the history
…hen `utcoffset()` gets passed a `None` argument. Which it shouldn't be getting in the first place.
  • Loading branch information
cmlenz committed Apr 6, 2010
1 parent aad11bd commit 9f099d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion babel/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def get_timezone_gmt(datetime=None, width='long', locale=LC_TIME):
datetime = datetime.replace(tzinfo=UTC)
locale = Locale.parse(locale)

offset = datetime.utcoffset()
offset = datetime.tzinfo.utcoffset(datetime)
seconds = offset.days * 24 * 60 * 60 + offset.seconds
hours, seconds = divmod(seconds, 3600)
if width == 'short':
Expand Down

0 comments on commit 9f099d3

Please sign in to comment.