Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f9bd914

Browse files
committed
Issue #665194: Added a small optimization
1 parent 1f924d2 commit f9bd914

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/email/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def localtime(dt=None, isdst=-1):
386386
387387
"""
388388
if dt is None:
389-
dt = datetime.datetime.now(datetime.timezone.utc)
389+
return datetime.datetime.now(datetime.timezone.utc).astimezone()
390390
if dt.tzinfo is not None:
391391
return dt.astimezone()
392392
# We have a naive datetime. Convert to a (localtime) timetuple and pass to

0 commit comments

Comments
 (0)