test/py: hush_if_test: Use open() in place of file()
authorPaul Burton <paul.burton@imgtec.com>
Thu, 14 Sep 2017 21:34:49 +0000 (14:34 -0700)
committerSimon Glass <sjg@chromium.org>
Tue, 10 Jul 2018 20:50:50 +0000 (14:50 -0600)
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>
test/py/tests/test_hush_if_test.py

index 1196e0a53ff99a4fec54fb84d80deba078280fb7..bba8d41d9648c9d57f9f99571bffbf844de9d754 100644 (file)
@@ -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)