another rework of event priorities. insert as >=, not as default

This commit is contained in:
jesopo 2020-02-13 23:56:04 +00:00
parent df38d7a57f
commit fc8e0f718c

View file

@ -160,12 +160,12 @@ class EventRoot(object):
hooked = False hooked = False
for i, other_hook in enumerate(hook_array): for i, other_hook in enumerate(hook_array):
if other_hook.priority > new_hook.priority: if other_hook.priority >= new_hook.priority:
hooked = True hooked = True
hook_array.insert(i, new_hook) hook_array.insert(i, new_hook)
break break
if not hooked: if not hooked:
hook_array.insert(0, new_hook) hook_array.append(new_hook)
return new_hook return new_hook
def _call(self, path: typing.List[str], kwargs: dict, safe: bool, def _call(self, path: typing.List[str], kwargs: dict, safe: bool,