diff mbox series

[2/4] binman: Correct some import statements

Message ID 20200805132745.2.I17a01474c421c1daedb4617a13425e7a5a291a38@changeid
State Accepted
Commit 07237988dcf88366ce4182eceac698cf1e97afc5
Delegated to: Simon Glass
Headers show
Series binman: Add support for Python installation | expand

Commit Message

Simon Glass Aug. 5, 2020, 7:27 p.m. UTC
Some of these were not converted when binman moved to use absolute paths.
Fix them.

Also drop the import of 'test' which is a directory, not a module.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/binman/control.py    | 4 ++--
 tools/binman/ftest.py      | 2 +-
 tools/binman/image_test.py | 2 +-
 tools/binman/main.py       | 1 -
 4 files changed, 4 insertions(+), 5 deletions(-)

Comments

Simon Glass Aug. 22, 2020, 11:17 p.m. UTC | #1
Some of these were not converted when binman moved to use absolute paths.
Fix them.

Also drop the import of 'test' which is a directory, not a module.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/binman/control.py    | 4 ++--
 tools/binman/ftest.py      | 2 +-
 tools/binman/image_test.py | 2 +-
 tools/binman/main.py       | 1 -
 4 files changed, 4 insertions(+), 5 deletions(-)

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/tools/binman/control.py b/tools/binman/control.py
index 69c36ed6582..60e89d3776b 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -123,7 +123,7 @@  def ReadEntry(image_fname, entry_path, decomp=True):
         data extracted from the entry
     """
     global Image
-    from image import Image
+    from binman.image import Image
 
     image = Image.FromFile(image_fname)
     entry = image.FindEntryPath(entry_path)
@@ -496,7 +496,7 @@  def Binman(args):
         return 0
 
     # Put these here so that we can import this module without libfdt
-    from image import Image
+    from binman.image import Image
     from binman import state
 
     if args.cmd in ['ls', 'extract', 'replace']:
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index fedcc1ada1b..5f650b5f94c 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -29,7 +29,7 @@  from dtoc import fdt
 from dtoc import fdt_util
 from binman.etype import fdtmap
 from binman.etype import image_header
-from image import Image
+from binman.image import Image
 from patman import command
 from patman import test_util
 from patman import tools
diff --git a/tools/binman/image_test.py b/tools/binman/image_test.py
index f85c3c51c0f..e351fa84ab3 100644
--- a/tools/binman/image_test.py
+++ b/tools/binman/image_test.py
@@ -6,7 +6,7 @@ 
 
 import unittest
 
-from image import Image
+from binman.image import Image
 from patman.test_util import capture_sys_output
 
 class TestImage(unittest.TestCase):
diff --git a/tools/binman/main.py b/tools/binman/main.py
index 3e463b0119b..8c1e478d54c 100755
--- a/tools/binman/main.py
+++ b/tools/binman/main.py
@@ -61,7 +61,6 @@  def RunTests(debug, verbosity, processes, test_preserve_dirs, args, toolpath):
     from binman import fdt_test
     from binman import ftest
     from binman import image_test
-    from binman import test
     import doctest
 
     result = unittest.TestResult()