]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Workaround for a weird bug with newer versions of pytz, which fails when `utcoffset...
authorChristopher Lenz <cmlenz@gmail.com>
Tue, 6 Apr 2010 11:45:01 +0000 (11:45 +0000)
committerChristopher Lenz <cmlenz@gmail.com>
Tue, 6 Apr 2010 11:45:01 +0000 (11:45 +0000)
babel/dates.py

index 7e39368e8139de1204c4cafb3ebcc54068292b8d..72c495c3f9bc5d36189c52b02ec3bf326a4cf9ca 100644 (file)
@@ -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':