Skip to content

Commit c8325f5

Browse files
committed
Ensure that we return integers for wall/cpu duration
Fixes #73
1 parent 3b88759 commit c8325f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

caso/record.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def wall_duration(self):
137137
duration = self._wall_duration
138138
elif None not in (self._start_time, self._end_time):
139139
duration = (self.end_time - self.start_time).total_seconds()
140-
return int(duration) if duration else duration
140+
return int(duration) if duration is not None else None
141141

142142
@wall_duration.setter
143143
def wall_duration(self, value):
@@ -152,7 +152,7 @@ def cpu_duration(self):
152152
duration = self._cpu_duration
153153
elif self.wall_duration is not None and self.cpu_count:
154154
duration = self.wall_duration * self.cpu_count
155-
return int(duration) if duration else duration
155+
return int(duration) if duration is not None else None
156156

157157
@cpu_duration.setter
158158
def cpu_duration(self, value):

0 commit comments

Comments
 (0)