mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-02 00:00:02 +00:00
Fix KeyError constructing groups when no module is present
This commit is contained in:
parent
64744a4938
commit
2d180489ce
@ -1577,7 +1577,7 @@ class Group:
|
|||||||
# This is pretty hacky
|
# This is pretty hacky
|
||||||
# It allows the module to be fetched if someone just constructs a bare Group object though.
|
# 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
|
self.module = inspect.currentframe().f_back.f_globals['__name__'] # type: ignore
|
||||||
except (AttributeError, IndexError):
|
except (AttributeError, IndexError, KeyError):
|
||||||
self.module = None
|
self.module = None
|
||||||
|
|
||||||
self._children: Dict[str, Union[Command, Group]] = {}
|
self._children: Dict[str, Union[Command, Group]] = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user