mirror of
https://github.com/nocturn9x/asyncevents.git
synced 2026-10-05 16:32:32 +02:00
Fixed coroutine function check for on_unknown_event inside AsyncEventEmitter's constructor
This commit is contained in:
1 parent
0df09f7887
commit
234dcb448e
1 file changed
+1
-1
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user