浏览代码

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 年之前
父节点
当前提交
9f9e8a4dda
共有 1 个文件被更改,包括 1 次插入1 次删除
  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)