mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[Core] Add error handling when [p]load tries to load "locales" (#6466)
This commit is contained in:
parent
d3887b595f
commit
4e27059209
@ -258,6 +258,12 @@ class CogManager:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
mod = import_module(real_name, package=package)
|
mod = import_module(real_name, package=package)
|
||||||
|
if mod.__spec__.name == "redbot.cogs.locales":
|
||||||
|
raise NoSuchCog(
|
||||||
|
"No core cog by the name of '{}' could be found.".format(name),
|
||||||
|
path=mod.__spec__.origin,
|
||||||
|
name=name,
|
||||||
|
)
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
if e.name == package + real_name:
|
if e.name == package + real_name:
|
||||||
raise NoSuchCog(
|
raise NoSuchCog(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user