]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
binman: Update entry_test to support Python 3
authorSimon Glass <sjg@chromium.org>
Sat, 18 May 2019 04:00:47 +0000 (22:00 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 10 Jul 2019 22:52:58 +0000 (16:52 -0600)
The reload() function is in a different place in Python 3. Update the code
to handle this.

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

index 1f7ff5b4e419e9676771da91456047b18f95ea72..b30a7beecc8d4b2b6e7b58f7750f9f374fe2d027 100644 (file)
@@ -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')