mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
parent
e4d9c41a77
commit
587e1a4ad8
2 changed files with 14 additions and 0 deletions
|
|
@ -53,6 +53,9 @@ def load_legacy_plugin(plugin, plugin_paths):
|
|||
if spec is None:
|
||||
raise ImportError('Cannot import plugin `{}`'.format(plugin))
|
||||
else:
|
||||
# Avoid loading the same plugin twice
|
||||
if spec.name in sys.modules:
|
||||
return sys.modules[spec.name]
|
||||
# create module object from spec
|
||||
mod = importlib.util.module_from_spec(spec)
|
||||
# place it into sys.modules cache
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue