diff options
author | Chris Laplante <chris.laplante@agilent.com> | 2024-02-21 20:36:53 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2024-03-01 05:19:53 -1000 |
commit | 6e8300c5bc6a21310efd48baf97e8a153c427533 (patch) | |
tree | 1f90d81ef38cead68771fc09b3c35c9a02412757 /scripts/lib/recipetool/create_buildsys_python.py | |
parent | 6cb27ba5379e0132d7ec46f1633c24855a3fa298 (diff) | |
download | poky-6e8300c5bc6a21310efd48baf97e8a153c427533.tar.gz |
recipetool/create_buildsys_python: use importlib instead of imp
'imp' was deprecated in Python 3.4 and removed in 3.12. The
piece of importlib we use has been around since 3.3.
(From OE-Core rev: b9dcdf2346bb24866c5f3db96a3f79eba20e4662)
Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Cherry-picked from master: 457f0dad87b4e45a53865b5ad2c150215bd74019
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'scripts/lib/recipetool/create_buildsys_python.py')
-rw-r--r-- | scripts/lib/recipetool/create_buildsys_python.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/scripts/lib/recipetool/create_buildsys_python.py b/scripts/lib/recipetool/create_buildsys_python.py index 5686a62d3f..a7eed3256f 100644 --- a/scripts/lib/recipetool/create_buildsys_python.py +++ b/scripts/lib/recipetool/create_buildsys_python.py | |||
@@ -10,7 +10,7 @@ import codecs | |||
10 | import collections | 10 | import collections |
11 | import setuptools.command.build_py | 11 | import setuptools.command.build_py |
12 | import email | 12 | import email |
13 | import imp | 13 | import importlib |
14 | import glob | 14 | import glob |
15 | import itertools | 15 | import itertools |
16 | import logging | 16 | import logging |
@@ -561,7 +561,6 @@ class PythonRecipeHandler(RecipeHandler): | |||
561 | return deps | 561 | return deps |
562 | 562 | ||
563 | def parse_pkgdata_for_python_packages(self): | 563 | def parse_pkgdata_for_python_packages(self): |
564 | suffixes = [t[0] for t in imp.get_suffixes()] | ||
565 | pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR') | 564 | pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR') |
566 | 565 | ||
567 | ldata = tinfoil.config_data.createCopy() | 566 | ldata = tinfoil.config_data.createCopy() |
@@ -585,7 +584,7 @@ class PythonRecipeHandler(RecipeHandler): | |||
585 | continue | 584 | continue |
586 | 585 | ||
587 | for fn in files_info: | 586 | for fn in files_info: |
588 | for suffix in suffixes: | 587 | for suffix in importlib.machinery.all_suffixes(): |
589 | if fn.endswith(suffix): | 588 | if fn.endswith(suffix): |
590 | break | 589 | break |
591 | else: | 590 | else: |