Browse Source

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>
Paul Burton 7 năm trước cách đây
mục cha
commit
9f9e8a4dda
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      test/py/tests/test_hush_if_test.py

+ 1 - 1
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)