diff options
author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2012-08-23 03:02:36 (GMT) |
---|---|---|
committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2012-08-23 03:02:36 (GMT) |
commit | f9bd9141c5b608cdd1149b0f8fa874debcf1e6fa (patch) | |
tree | 48cdb5e876289475f35cbe0eb1e8737ab8079843 /Lib/email | |
parent | 1f924d21d3f8a7fba3409544abca53a814de15f6 (diff) | |
download | cpython-f9bd9141c5b608cdd1149b0f8fa874debcf1e6fa.zip cpython-f9bd9141c5b608cdd1149b0f8fa874debcf1e6fa.tar.gz cpython-f9bd9141c5b608cdd1149b0f8fa874debcf1e6fa.tar.bz2 |
Issue #665194: Added a small optimization
Diffstat (limited to 'Lib/email')
-rw-r--r-- | Lib/email/utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/email/utils.py b/Lib/email/utils.py index f32cdd9..73bc348 100644 --- a/Lib/email/utils.py +++ b/Lib/email/utils.py @@ -386,7 +386,7 @@ def localtime(dt=None, isdst=-1): """ if dt is None: - dt = datetime.datetime.now(datetime.timezone.utc) + return datetime.datetime.now(datetime.timezone.utc).astimezone() if dt.tzinfo is not None: return dt.astimezone() # We have a naive datetime. Convert to a (localtime) timetuple and pass to |