Updated per code review comments

This commit is contained in:
Nathan Byrd 2021-03-10 19:26:34 -06:00
parent 371deae98f
commit d1f502ffd5

View file

@ -1284,8 +1284,7 @@ class datetime(date):
A timezone info object may be passed in as well.
"""
if isinstance(t, float):
frac = t - int(t)
t = int(t)
frac, t = _math.modf(t)
us = round(frac * 1e6)
if us >= 1000000:
t += 1
@ -1294,7 +1293,6 @@ class datetime(date):
t -= 1
us += 1000000
else:
frac = 0
us = 0
if utc: