diff --git a/pysnooper/pycompat.py b/pysnooper/pycompat.py index 1899ff8..c6b23b3 100644 --- a/pysnooper/pycompat.py +++ b/pysnooper/pycompat.py @@ -90,9 +90,6 @@ else: return datetime_module.time(hour, minute, second, microsecond) -def timedelta_isoformat(timedelta, timespec='microseconds'): - assert isinstance(timedelta, datetime_module.timedelta) - if timespec != 'microseconds': - raise NotImplementedError +def timedelta_isoformat(timedelta): time = (datetime_module.datetime.min + timedelta).time() - return time_isoformat(time, timespec) + return time_isoformat(time) diff --git a/pysnooper/tracer.py b/pysnooper/tracer.py index c7d6e49..1c9103b 100644 --- a/pysnooper/tracer.py +++ b/pysnooper/tracer.py @@ -368,7 +368,7 @@ class Tracer: if self.elapsed_time: duration = datetime_module.datetime.now() - self.start_times[-1] now_string = pycompat.timedelta_isoformat( - duration, timespec='microseconds') if not self.normalize else ' ' * 15 + duration) 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