summaryrefslogtreecommitdiff
path: root/tools/binman/main.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-04-17 18:09:03 -0600
committerSimon Glass <sjg@chromium.org>2020-04-26 14:25:21 -0600
commit16287933a852bab2ac4985a770e08c9aa69d21b1 (patch)
treee907492e72c279b64ac971c916de8078a48e8157 /tools/binman/main.py
parent0ede00fdaf1d2162350631294f57645675737d89 (diff)
binman: Move to absolute imports
At present binman sets the python path on startup so that it can access the libraries it needs. If we convert to use absolute imports this is not necessary. Move binman to use absolute imports. This enables removable of the path adjusting in Entry also. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/main.py')
-rwxr-xr-xtools/binman/main.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/tools/binman/main.py b/tools/binman/main.py
index a17764cdb00..8736938d119 100755
--- a/tools/binman/main.py
+++ b/tools/binman/main.py
@@ -20,8 +20,8 @@ import unittest
# Bring in the patman and dtoc libraries (but don't override the first path
# in PYTHONPATH)
our_path = os.path.dirname(os.path.realpath(__file__))
-for dirname in ['../patman', '../dtoc', '..', '../concurrencytest']:
- sys.path.insert(2, os.path.join(our_path, dirname))
+for dirname in ['../patman', '../dtoc', '../concurrencytest', '..']:
+ sys.path.insert(2, os.path.realpath(os.path.join(our_path, dirname)))
# Bring in the libfdt module
sys.path.insert(2, 'scripts/dtc/pylibfdt')
@@ -34,9 +34,8 @@ sys.path.insert(2, os.path.join(our_path,
# that is not available in a virtualenv.
sys.path.append(get_python_lib())
-import cmdline
-import command
-import control
+from binman import cmdline
+from binman import control
import test_util
def RunTests(debug, verbosity, processes, test_preserve_dirs, args, toolpath):
@@ -55,13 +54,13 @@ def RunTests(debug, verbosity, processes, test_preserve_dirs, args, toolpath):
name to execute (as in 'binman test testSections', for example)
toolpath: List of paths to use for tools
"""
- import cbfs_util_test
- import elf_test
- import entry_test
- import fdt_test
- import ftest
- import image_test
- import test
+ from binman import cbfs_util_test
+ from binman import elf_test
+ from binman import entry_test
+ from binman import fdt_test
+ from binman import ftest
+ from binman import image_test
+ from binman import test
import doctest
result = unittest.TestResult()