Fixed coroutine function check for on_unknown_event inside AsyncEventEmitter's constructor
This commit is contained in:
parent
0df09f7887
commit
234dcb448e
|
@ -165,7 +165,7 @@ class AsyncEventEmitter:
|
||||||
"expected on_error to be a coroutine function or an entry from the ExceptionHandling"
|
"expected on_error to be a coroutine function or an entry from the ExceptionHandling"
|
||||||
f" enum, found {type(on_error).__name__!r} instead"
|
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):
|
if inspect.iscoroutine(on_unknown_event):
|
||||||
raise TypeError(
|
raise TypeError(
|
||||||
"on_unknown_event should be a coroutine *function*, not a coroutine! Pass the function"
|
"on_unknown_event should be a coroutine *function*, not a coroutine! Pass the function"
|
||||||
|
|
Loading…
Reference in New Issue