mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-05 17:02:32 -05:00
[Core] Add error handling when [p]load tries to load "locales" (#6466)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user