]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
buildman: Use importlib to find the help
authorSimon Glass <sjg@chromium.org>
Fri, 24 Feb 2023 01:18:12 +0000 (18:18 -0700)
committerSimon Glass <sjg@chromium.org>
Wed, 8 Mar 2023 19:40:49 +0000 (11:40 -0800)
Use this function so that the help can be found even when buildman is
running from a package.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/buildman/control.py

index aacfb2fc0db0eec843afbb8f0c2fe770e195bbe8..35f44c0cf3db5b31374e2d24858ccdb73e152360 100644 (file)
@@ -3,6 +3,7 @@
 #
 
 import multiprocessing
+import importlib.resources
 import os
 import shutil
 import subprocess
@@ -152,9 +153,8 @@ def DoBuildman(options, args, toolchains=None, make_func=None, brds=None,
     global builder
 
     if options.full_help:
-        tools.print_full_help(
-            os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),
-                         'README.rst'))
+        with importlib.resources.path('buildman', 'README.rst') as readme:
+            tools.print_full_help(str(readme))
         return 0
 
     gitutil.setup()