From 0eb378c6272c4bcec3a5682041fdf6d4b31547b9 Mon Sep 17 00:00:00 2001 From: Pedro Rodrigues Date: Fri, 17 Nov 2023 08:29:44 +0100 Subject: [PATCH] Fix issue while decorating function multiple times closes #5 --- sched2.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sched2.py b/sched2.py index 1dee307..89bbde7 100644 --- a/sched2.py +++ b/sched2.py @@ -67,6 +67,11 @@ def repeater(action): self.enter(delay, priority, repeater, (partial_action,)) + # this return value is used by the decorator + # do not change this to return partial_action + # we return the original action so it can be decorated multiple times + return action + def every(self, delay, priority=0, immediate=True): """Schedule an event to be run at regular intervals using a decorator.