mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-09-21 03:27:42 +00:00
Use iscoroutinefunction from inspect instead of asyncio on 3.12+
This commit is contained in:
+2
-2
@@ -68,7 +68,7 @@ from .voice_client import VoiceClient
|
||||
from .http import HTTPClient
|
||||
from .state import ConnectionState
|
||||
from . import utils
|
||||
from .utils import MISSING, time_snowflake, deprecated
|
||||
from .utils import MISSING, time_snowflake, deprecated, _iscoroutinefunction
|
||||
from .object import Object
|
||||
from .backoff import ExponentialBackoff
|
||||
from .webhook import Webhook
|
||||
@@ -2098,7 +2098,7 @@ class Client:
|
||||
The coroutine passed is not actually a coroutine.
|
||||
"""
|
||||
|
||||
if not asyncio.iscoroutinefunction(coro):
|
||||
if not _iscoroutinefunction(coro):
|
||||
raise TypeError('event registered must be a coroutine function')
|
||||
|
||||
setattr(self, coro.__name__, coro)
|
||||
|
||||
Reference in New Issue
Block a user