mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-12-19 08:21:27 +01:00
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 <amadeus@jmu.edu.cn>
Acked-by: Quentin Schulz <quentin.schulz@cherry.de>
[trini: Re-add # pragma: no cover line]
Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
97e202a721
commit
02aa1a56a7
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user