]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tools: Fall back to importlib_resources on Python 3.6
authorJan Kiszka <jan.kiszka@siemens.com>
Sat, 22 Apr 2023 14:42:48 +0000 (16:42 +0200)
committerSimon Glass <sjg@chromium.org>
Fri, 28 Apr 2023 17:49:00 +0000 (11:49 -0600)
importlib.resources became part of 3.7 only. Allow using distros with
3.6 and the importlib_resources backport.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
tools/binman/control.py
tools/buildman/control.py
tools/patman/__main__.py

index 0febcb79a60515549d58a4b258ab6a7d7beeab1b..68597c4e77923f19e63bf29b66ea51e30c92f8aa 100644 (file)
@@ -7,7 +7,11 @@
 
 from collections import OrderedDict
 import glob
-import importlib.resources
+try:
+    import importlib.resources
+except ImportError:
+    # for Python 3.6
+    import importlib_resources
 import os
 import pkg_resources
 import re
index 35f44c0cf3db5b31374e2d24858ccdb73e152360..09a11f25b3f33c7784e3b4fc38337a28323f6263 100644 (file)
@@ -3,7 +3,11 @@
 #
 
 import multiprocessing
-import importlib.resources
+try:
+    import importlib.resources
+except ImportError:
+    # for Python 3.6
+    import importlib_resources
 import os
 import shutil
 import subprocess
index 48ffbc8eadf76ddb55c6e3235f58daa864f59ddd..8eba5d34864ce799da4e6b520ecfe5053825a038 100755 (executable)
@@ -7,7 +7,11 @@
 """See README for more information"""
 
 from argparse import ArgumentParser
-import importlib.resources
+try:
+    import importlib.resources
+except ImportError:
+    # for Python 3.6
+    import importlib_resources
 import os
 import re
 import sys