aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2021-01-21 03:51:32 +0100
committerGravatar Numerlor <[email protected]>2021-01-21 03:51:32 +0100
commit69c98d95b436063684d5d004aead85ba3b9514ef (patch)
tree46b44e7e3425c199a7628aba3aa7865dd2a081a8
parentUse a defaultdict for item futures (diff)
Use inspect.unwrap instead of manually unwrapping
-rw-r--r--bot/exts/info/source.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/bot/exts/info/source.py b/bot/exts/info/source.py
index ae68ef7e8..f03b6a46f 100644
--- a/bot/exts/info/source.py
+++ b/bot/exts/info/source.py
@@ -68,9 +68,7 @@ class BotSource(commands.Cog):
Raise BadArgument if `source_item` is a dynamically-created object (e.g. via internal eval).
"""
if isinstance(source_item, commands.Command):
- source_item = source_item.callback
- while hasattr(source_item, "__wrapped__"):
- source_item = source_item.__wrapped__
+ source_item = inspect.unwrap(source_item.callback)
src = source_item.__code__
filename = src.co_filename
elif isinstance(source_item, str):