From 69c98d95b436063684d5d004aead85ba3b9514ef Mon Sep 17 00:00:00 2001 From: Numerlor <25886452+Numerlor@users.noreply.github.com> Date: Thu, 21 Jan 2021 03:51:32 +0100 Subject: Use inspect.unwrap instead of manually unwrapping --- bot/exts/info/source.py | 4 +--- 1 file changed, 1 insertion(+), 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): -- cgit v1.2.3