Skip to content

Commit 94197b3

Browse files
committed
insert new hooks at the start of their priority, to prevent duplicates on reload
1 parent 24cd513 commit 94197b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/EventManager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def _hook(self, path: typing.List[str], func: CALLBACK_TYPE,
165165
hook_array.insert(i, new_hook)
166166
break
167167
if not hooked:
168-
hook_array.append(new_hook)
168+
hook_array.insert(0, new_hook)
169169
return new_hook
170170

171171
def _call(self, path: typing.List[str], kwargs: dict, safe: bool,

0 commit comments

Comments
 (0)