summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-02-24 04:18:20 +0300
committerSimon Glass <sjg@chromium.org>2023-03-08 22:40:56 +0300
commit8de6adbf4a92ae49af7fb48bbb6d2cf4ae0b8f60 (patch)
treee60634ecc9eb41cba133a6e54c8c168bb9680773 /tools
parent94bb5cd2f9960baa724976a44303067dd4654b2e (diff)
downloadu-boot-8de6adbf4a92ae49af7fb48bbb6d2cf4ae0b8f60.tar.xz
binman: Use importlib to find the help
Use this function so that the help can be found even when binman is running from a package. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/binman/control.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/binman/control.py b/tools/binman/control.py
index 9b183eda73..2900538ffc 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -7,6 +7,7 @@
from collections import OrderedDict
import glob
+import importlib.resources
import os
import pkg_resources
import re
@@ -641,9 +642,8 @@ def Binman(args):
global state
if args.full_help:
- tools.print_full_help(
- os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), 'README.rst')
- )
+ with importlib.resources.path('binman', 'README.rst') as readme:
+ tools.print_full_help(str(readme))
return 0
# Put these here so that we can import this module without libfdt