mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-19 03:15:00 +00:00
buildman: Fix full help for Python 3.8
With Python versions older than 3.9 Buildman produces an error on start-up. Fix this with a workaround for importlib. There is already a workaround for v3.6 but I am not sure if that is still functioning. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
8acdb70c10
commit
305114eb83
1 changed files with 8 additions and 2 deletions
|
@ -7,7 +7,7 @@
|
|||
"""See README for more information"""
|
||||
|
||||
try:
|
||||
from importlib.resources import files
|
||||
import importlib.resources
|
||||
except ImportError:
|
||||
# for Python 3.6
|
||||
import importlib_resources
|
||||
|
@ -83,7 +83,13 @@ def run_buildman():
|
|||
run_test_coverage()
|
||||
|
||||
elif args.full_help:
|
||||
tools.print_full_help(str(files('buildman').joinpath('README.rst')))
|
||||
if hasattr(importlib.resources, 'files'):
|
||||
dirpath = importlib.resources.files('buildman')
|
||||
tools.print_full_help(str(dirpath.joinpath('README.rst')))
|
||||
else:
|
||||
with importlib.resources.path('buildman', 'README.rst') as readme:
|
||||
tools.print_full_help(str(readme))
|
||||
|
||||
|
||||
# Build selected commits for selected boards
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue