From: Armin Ronacher Date: Sat, 6 Jul 2013 11:48:51 +0000 (+0200) Subject: Make local time the default for some functions that previously did not have it X-Git-Tag: 1.0~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf072a6244aa5a04ae0758fc999a9bde030df409;p=thirdparty%2Fbabel.git Make local time the default for some functions that previously did not have it --- diff --git a/babel/dates.py b/babel/dates.py index ee072f2b..e6041476 100644 --- a/babel/dates.py +++ b/babel/dates.py @@ -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 `_ """ - 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)):