binman: Update entry_test to support Python 3

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>
This commit is contained in:
Simon Glass 2019-05-17 22:00:47 -06:00
parent c6c10e77fb
commit 0199d19349

View 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')