diff options
Diffstat (limited to 'scripts/lib/wic/pluginbase.py')
| -rw-r--r-- | scripts/lib/wic/pluginbase.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/lib/wic/pluginbase.py b/scripts/lib/wic/pluginbase.py index d9b4e57747..b64568339b 100644 --- a/scripts/lib/wic/pluginbase.py +++ b/scripts/lib/wic/pluginbase.py | |||
| @@ -9,9 +9,11 @@ __all__ = ['ImagerPlugin', 'SourcePlugin'] | |||
| 9 | 9 | ||
| 10 | import os | 10 | import os |
| 11 | import logging | 11 | import logging |
| 12 | import types | ||
| 12 | 13 | ||
| 13 | from collections import defaultdict | 14 | from collections import defaultdict |
| 14 | from importlib.machinery import SourceFileLoader | 15 | import importlib |
| 16 | import importlib.util | ||
| 15 | 17 | ||
| 16 | from wic import WicError | 18 | from wic import WicError |
| 17 | from wic.misc import get_bitbake_var | 19 | from wic.misc import get_bitbake_var |
| @@ -54,7 +56,9 @@ class PluginMgr: | |||
| 54 | mname = fname[:-3] | 56 | mname = fname[:-3] |
| 55 | mpath = os.path.join(ppath, fname) | 57 | mpath = os.path.join(ppath, fname) |
| 56 | logger.debug("loading plugin module %s", mpath) | 58 | logger.debug("loading plugin module %s", mpath) |
| 57 | SourceFileLoader(mname, mpath).load_module() | 59 | spec = importlib.util.spec_from_file_location(mname, mpath) |
| 60 | module = importlib.util.module_from_spec(spec) | ||
| 61 | spec.loader.exec_module(module) | ||
| 58 | 62 | ||
| 59 | return PLUGINS.get(ptype) | 63 | return PLUGINS.get(ptype) |
| 60 | 64 | ||
