Skip to content

Commit 2762dd3

Browse files
authored
Merge pull request #116 from dlashua/repeaer_fix
change repeaer to reaper
2 parents 62f0156 + aa52c1c commit 2762dd3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

custom_components/pyscript/function.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Function:
5151
# task id of the task that cancels and waits for other tasks,
5252
# and also awaits on coros
5353
#
54-
task_repeaer = None
54+
task_reaper = None
5555

5656
def __init__(self):
5757
"""Warn on Function instantiation."""
@@ -108,17 +108,17 @@ async def task_reaper(reaper_q):
108108
except Exception:
109109
_LOGGER.error("task_reaper: got exception %s", traceback.format_exc(-1))
110110

111-
if not cls.task_repeaer:
111+
if not cls.task_reaper:
112112
cls.task_reaper_q = asyncio.Queue(0)
113-
cls.task_repeaer = Function.create_task(task_reaper(cls.task_reaper_q))
113+
cls.task_reaper = Function.create_task(task_reaper(cls.task_reaper_q))
114114

115115
@classmethod
116116
async def reaper_stop(cls):
117117
"""Tell the reaper task to exit by sending a special task None."""
118-
if cls.task_repeaer:
118+
if cls.task_reaper:
119119
cls.task_reaper_q.put_nowait(["exit"])
120-
await cls.task_repeaer
121-
cls.task_repeaer = None
120+
await cls.task_reaper
121+
cls.task_reaper = None
122122
cls.task_reaper_q = None
123123

124124
@classmethod
@@ -180,7 +180,7 @@ async def task_unique(name, kill_me=False):
180180
if task != curr_task:
181181
#
182182
# it seems we can't cancel ourselves, so we
183-
# tell the repeaer task to cancel us
183+
# tell the reaper task to cancel us
184184
#
185185
Function.reaper_cancel(curr_task)
186186
# wait to be canceled

0 commit comments

Comments
 (0)