]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
patman: Correct Python 3.6 behaviour
authorSimon Glass <sjg@chromium.org>
Sat, 4 Nov 2023 16:25:24 +0000 (10:25 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 15 Nov 2023 03:04:01 +0000 (20:04 -0700)
The importlib_resources import is not actually used. Fix this so that
patman can run on Python 3.6 to some extent, once
'pip3 install importlib-resources' has been run.

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

index d53f686a2d45dc2128c053f9c9e85638222e3427..f645b38b6470542ea7b31a54167861eecc943b40 100755 (executable)
@@ -7,10 +7,10 @@
 """See README for more information"""
 
 try:
-    import importlib.resources
+    from importlib import resources
 except ImportError:
     # for Python 3.6
-    import importlib_resources
+    import importlib_resources as resources
 import os
 import re
 import sys
@@ -69,7 +69,7 @@ def run_patman():
                                 print(cca)
 
         elif args.full_help:
-            with importlib.resources.path('patman', 'README.rst') as readme:
+            with resources.path('patman', 'README.rst') as readme:
                 tools.print_full_help(str(readme))
         else:
             # If we are not processing tags, no need to warning about bad ones