summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorChris Laplante <chris.laplante@agilent.com>2023-10-03 16:19:54 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-06 11:51:11 +0100
commit893e17f669abfd81bd55993e3060fc970ecd0683 (patch)
tree895ce01eb63520955d9cae577d8fbe7dde12c8b0 /scripts
parentef66352fccd6dcb43fc49730b2b6e51707bb706c (diff)
downloadpoky-893e17f669abfd81bd55993e3060fc970ecd0683.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: 457f0dad87b4e45a53865b5ad2c150215bd74019) 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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/recipetool/create_buildsys_python.py5
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 4675cc68fa..92468b2254 100644
--- a/scripts/lib/recipetool/create_buildsys_python.py
+++ b/scripts/lib/recipetool/create_buildsys_python.py
@@ -10,7 +10,7 @@ import codecs
10import collections 10import collections
11import setuptools.command.build_py 11import setuptools.command.build_py
12import email 12import email
13import imp 13import importlib
14import glob 14import glob
15import itertools 15import itertools
16import logging 16import 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: