[U-Boot] [PATCH 17/24] binman: Update entry_test to support Python 3

Simon Glass sjg at chromium.org
Sat May 18 04:00:47 UTC 2019


The reload() function is in a different place in Python 3. Update the code
to handle this.

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

 tools/binman/entry_test.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/binman/entry_test.py b/tools/binman/entry_test.py
index 1f7ff5b4e41..b30a7beecc8 100644
--- a/tools/binman/entry_test.py
+++ b/tools/binman/entry_test.py
@@ -41,7 +41,11 @@ class TestEntry(unittest.TestCase):
         del sys.modules['importlib']
         global entry
         if entry:
-            reload(entry)
+            if sys.version_info[0] >= 3:
+                import importlib
+                importlib.reload(entry)
+            else:
+                reload(entry)
         else:
             import entry
         entry.Entry.Create(None, self.GetNode(), 'u-boot-spl')
-- 
2.21.0.1020.gf2820cf01a-goog



More information about the U-Boot mailing list