Fixed timedelta_isoformat

This commit is contained in:
iory 2020-04-18 23:37:03 +09:00 committed by Ram Rachum
parent 0cb6df1f7b
commit 48cc9d94cd
2 changed files with 3 additions and 3 deletions

View file

@ -90,6 +90,6 @@ else:
return datetime_module.time(hour, minute, second, microsecond)
def timedelta_isoformat(timedelta):
def timedelta_isoformat(timedelta, timespec='microseconds'):
time = (datetime_module.datetime.min + timedelta).time()
return time_isoformat(time)
return time_isoformat(time, timespec)

View file

@ -374,7 +374,7 @@ class Tracer:
start_time = self.start_times[frame]
duration = datetime_module.datetime.now() - start_time
now_string = pycompat.timedelta_isoformat(
duration) if not self.normalize else ' ' * 15
duration, timespec='microseconds') if not self.normalize else ' ' * 15
else:
now = datetime_module.datetime.now().time()
now_string = pycompat.time_isoformat(now, timespec='microseconds') if not self.normalize else ' ' * 15