summaryrefslogtreecommitdiffstats
path: root/Lib/email
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2012-08-23 03:02:36 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2012-08-23 03:02:36 (GMT)
commitf9bd9141c5b608cdd1149b0f8fa874debcf1e6fa (patch)
tree48cdb5e876289475f35cbe0eb1e8737ab8079843 /Lib/email
parent1f924d21d3f8a7fba3409544abca53a814de15f6 (diff)
downloadcpython-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.py2
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