Kaydet (Commit) f9bd9141 authored tarafından Alexander Belopolsky's avatar Alexander Belopolsky

Issue #665194: Added a small optimization

üst 1f924d21
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment