mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -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:
|
||||
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:
|
||||
if e.name == package + real_name:
|
||||
raise NoSuchCog(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user