Skip to content

Commit 2fc8729

Browse files
authored
Changed Delay to return 0 instead of None for certain functions.
1 parent a528adf commit 2fc8729

File tree

1 file changed

+3
-5
lines changed
  • addons/source-python/packages/source-python/listeners

1 file changed

+3
-5
lines changed

addons/source-python/packages/source-python/listeners/tick.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ def time_remaining(self):
181181
:rtype: float
182182
"""
183183
if not self.running:
184-
# TODO: what should we return here, or should we raise an error?
185-
return None
184+
return 0
186185
return self.exec_time - time.time()
187186

188187
@property
@@ -192,8 +191,7 @@ def time_elapsed(self):
192191
:rtype: float
193192
"""
194193
if not self.running:
195-
# TODO: what should we return here, or should we raise an error?
196-
return None
194+
return 0
197195
return time.time() - self._start_time
198196

199197
def _unload_instance(self):
@@ -314,7 +312,7 @@ def total_time_remaining(self):
314312
315313
:rtype: float
316314
"""
317-
if self.delay_time_remaining is None:
315+
if not self.delay_time_remaining:
318316
return 0
319317
return (
320318
(self.loops_remaining - 1) * self.interval +

0 commit comments

Comments
 (0)