test/py: hush_if_test: Use open() in place of file()

In python 3.x the file() function has been removed. Use open() instead,
which works on both python 2.x & 3.x, and is described as the preferred
method of opening a file by python 2.x documentation anyway.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
lime2-spi
Paul Burton 7 years ago committed by Simon Glass
parent 57bf9bea34
commit 9f9e8a4dda
  1. 2
      test/py/tests/test_hush_if_test.py

@ -148,7 +148,7 @@ def test_hush_if_test_host_file_exists(u_boot_console):
exec_hush_if(u_boot_console, expr, False)
try:
with file(test_file, 'wb'):
with open(test_file, 'wb'):
pass
assert os.path.exists(test_file)

Loading…
Cancel
Save