Fixed coroutine function check for on_unknown_event inside AsyncEventEmitter's constructor

This commit is contained in:
nocturn9x 2021-12-29 12:06:59 +01:00
parent 0df09f7887
commit 234dcb448e
1 changed files with 1 additions and 1 deletions

View File

@ -165,7 +165,7 @@ class AsyncEventEmitter:
"expected on_error to be a coroutine function or an entry from the ExceptionHandling"
f" enum, found {type(on_error).__name__!r} instead"
)
if inspect.iscoroutinefunction(on_unknown_event) and on_unknown_event not in UnknownEventHandling:
if not inspect.iscoroutinefunction(on_unknown_event) and on_unknown_event not in UnknownEventHandling:
if inspect.iscoroutine(on_unknown_event):
raise TypeError(
"on_unknown_event should be a coroutine *function*, not a coroutine! Pass the function"