diff options
| -rw-r--r-- | bitbake/lib/bb/utils.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 73b6cb423b..461122bba1 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
| @@ -27,7 +27,8 @@ import bb | |||
| 27 | import bb.msg | 27 | import bb.msg |
| 28 | import multiprocessing | 28 | import multiprocessing |
| 29 | import fcntl | 29 | import fcntl |
| 30 | import imp | 30 | import importlib |
| 31 | from importlib import machinery | ||
| 31 | import itertools | 32 | import itertools |
| 32 | import subprocess | 33 | import subprocess |
| 33 | import glob | 34 | import glob |
| @@ -43,7 +44,7 @@ from contextlib import contextmanager | |||
| 43 | from ctypes import cdll | 44 | from ctypes import cdll |
| 44 | 45 | ||
| 45 | logger = logging.getLogger("BitBake.Util") | 46 | logger = logging.getLogger("BitBake.Util") |
| 46 | python_extensions = [e for e, _, _ in imp.get_suffixes()] | 47 | python_extensions = importlib.machinery.all_suffixes() |
| 47 | 48 | ||
| 48 | 49 | ||
| 49 | def clean_context(): | 50 | def clean_context(): |
| @@ -1544,12 +1545,9 @@ def export_proxies(d): | |||
| 1544 | def load_plugins(logger, plugins, pluginpath): | 1545 | def load_plugins(logger, plugins, pluginpath): |
| 1545 | def load_plugin(name): | 1546 | def load_plugin(name): |
| 1546 | logger.debug(1, 'Loading plugin %s' % name) | 1547 | logger.debug(1, 'Loading plugin %s' % name) |
| 1547 | fp, pathname, description = imp.find_module(name, [pluginpath]) | 1548 | spec = importlib.machinery.PathFinder.find_spec(name, path=[pluginpath] ) |
| 1548 | try: | 1549 | if spec: |
| 1549 | return imp.load_module(name, fp, pathname, description) | 1550 | return spec.loader.load_module() |
| 1550 | finally: | ||
| 1551 | if fp: | ||
| 1552 | fp.close() | ||
| 1553 | 1551 | ||
| 1554 | logger.debug(1, 'Loading plugins from %s...' % pluginpath) | 1552 | logger.debug(1, 'Loading plugins from %s...' % pluginpath) |
| 1555 | 1553 | ||
