summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChukun Pan <[email protected]>2025-12-02 18:00:00 +0800
committerTom Rini <[email protected]>2025-12-04 13:45:10 -0600
commit02aa1a56a7cfcb858973ef8965e54cf539060fd9 (patch)
tree56b0927c7223556eb2cf95277dd1c0dbee5e8757 /tools
parent97e202a72160ea038dda46130d911546e66a189c (diff)
binman: fallback to importlib_resources on Python 3.8
Python 3.7 and 3.8 lack the files attribute in importlib.resources. Use importlib_resources to fix build errors with Python 3.8: binman: module 'importlib.resources' has no attribute 'files' Fixes: 538719cb6a77 ("binman: migrate from pkg_resources to importlib") Signed-off-by: Chukun Pan <[email protected]> Acked-by: Quentin Schulz <[email protected]> [trini: Re-add # pragma: no cover line] Signed-off-by: Tom Rini <[email protected]>
Diffstat (limited to 'tools')
-rw-r--r--tools/binman/control.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/binman/control.py b/tools/binman/control.py
index 1307222591d..816f7c1eba2 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -9,8 +9,9 @@ from collections import OrderedDict
import glob
try:
import importlib.resources as importlib_resources
-except ImportError: # pragma: no cover
- # for Python 3.6
+ # for Python 3.6, 3.7 and 3.8
+ importlib_resources.files
+except (ImportError, AttributeError): # pragma: no cover
import importlib_resources
import os
import re