diff --git a/src/common/actionflow.py b/src/common/actionflow.py index 398dcd2..9ff4ab2 100644 --- a/src/common/actionflow.py +++ b/src/common/actionflow.py @@ -24,7 +24,7 @@ class ActionFlow: def do(self, action: type[Action]): name = action.__name__ index = self.indices.get(name) - assert index is not None + assert index is not None, "Action '%s' is not registered" % name if self.on[index]: raise Unavailable(name) if self.on[index] is None: raise NotAllowed(name) @@ -40,7 +40,7 @@ class ActionFlow: def index(self, action: type[Action]) -> int: name = action.__name__ index = self.indices.get(name) - assert index is not None + assert index is not None, "Action '%s' is not registered" % name return index def allow(self, action: type[Action], value=True): diff --git a/src/common/timer.py b/src/common/timer.py index f006d73..e7bc1a7 100644 --- a/src/common/timer.py +++ b/src/common/timer.py @@ -14,9 +14,9 @@ class Timer: self.checkpoint = seconds def pause(self): - assert self.checkpoint is not None + assert self.checkpoint is not None, "Uninitialized" self.accumulator = self.delta() def delta(self): - assert self.checkpoint is not None + assert self.checkpoint is not None, "Uninitialized" return floor(time()) - self.checkpoint + self.accumulator