Skip to content

Commit

Permalink
Fix issue while decorating function multiple times
Browse files Browse the repository at this point in the history
closes #5
  • Loading branch information
medecau committed Nov 17, 2023
1 parent 4ee4b9b commit 0eb378c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sched2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0eb378c

Please sign in to comment.