mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-09 04:38:55 -05:00
[Dev] Use isawaitable over iscoroutine for [p]debug (#2202)
Allows for non-coroutine awaitables (such as config's `_ValueCtxManager`) to be awaited from debug. Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
This commit is contained in:
parent
748847d5bf
commit
ba605495ac
@ -116,7 +116,7 @@ class Dev(commands.Cog):
|
|||||||
await ctx.send(box("{}: {!s}".format(type(e).__name__, e), lang="py"))
|
await ctx.send(box("{}: {!s}".format(type(e).__name__, e), lang="py"))
|
||||||
return
|
return
|
||||||
|
|
||||||
if asyncio.iscoroutine(result):
|
if inspect.isawaitable(result):
|
||||||
result = await result
|
result = await result
|
||||||
|
|
||||||
self._last_result = result
|
self._last_result = result
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user