Browse Source

Fix KeyError constructing groups when no module is present

pull/8429/head
Lilly Rose Berner 3 years ago
committed by GitHub
parent
commit
2d180489ce
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      discord/app_commands/commands.py

2
discord/app_commands/commands.py

@ -1577,7 +1577,7 @@ class Group:
# This is pretty hacky
# It allows the module to be fetched if someone just constructs a bare Group object though.
self.module = inspect.currentframe().f_back.f_globals['__name__'] # type: ignore
except (AttributeError, IndexError):
except (AttributeError, IndexError, KeyError):
self.module = None
self._children: Dict[str, Union[Command, Group]] = {}

Loading…
Cancel
Save