From: Chukun Pan Date: Tue, 2 Dec 2025 10:00:00 +0000 (+0800) Subject: binman: fallback to importlib_resources on Python 3.8 X-Git-Tag: v2026.01-rc4~13 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02aa1a56a7cfcb858973ef8965e54cf539060fd9;p=pandora-u-boot.git 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 Acked-by: Quentin Schulz [trini: Re-add # pragma: no cover line] Signed-off-by: Tom Rini --- 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