]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Make local time the default for some functions that previously did not have it
authorArmin Ronacher <armin.ronacher@active-4.com>
Sat, 6 Jul 2013 11:48:51 +0000 (13:48 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Sat, 6 Jul 2013 11:48:51 +0000 (13:48 +0200)
babel/dates.py

index ee072f2ba87c10c84f0afede4bf879416fc5512e..e604147608574706e8f804d6321e3458870dd139 100644 (file)
@@ -336,7 +336,10 @@ def get_timezone_location(dt_or_tzinfo=None, locale=LC_TIME):
     :rtype: `unicode`
     :since: version 0.9
     """
-    if dt_or_tzinfo is None or isinstance(dt_or_tzinfo, (int, long)):
+    if dt_or_tzinfo is None:
+        dt = None
+        tzinfo = LOCALTZ
+    elif dt_or_tzinfo is None or isinstance(dt_or_tzinfo, (int, long)):
         dt = None
         tzinfo = UTC
     elif isinstance(dt_or_tzinfo, (datetime, time)):
@@ -442,7 +445,10 @@ def get_timezone_name(dt_or_tzinfo=None, width='long', uncommon=False,
     :see:  `LDML Appendix J: Time Zone Display Names
             <http://www.unicode.org/reports/tr35/#Time_Zone_Fallback>`_
     """
-    if dt_or_tzinfo is None or isinstance(dt_or_tzinfo, (int, long)):
+    if dt_or_tzinfo is None:
+        dt = None
+        tzinfo = LOCALTZ
+    elif dt_or_tzinfo is None or isinstance(dt_or_tzinfo, (int, long)):
         dt = None
         tzinfo = UTC
     elif isinstance(dt_or_tzinfo, (datetime, time)):