diff --git a/mlir/test/python/execution_engine.py b/mlir/test/python/execution_engine.py --- a/mlir/test/python/execution_engine.py +++ b/mlir/test/python/execution_engine.py @@ -557,7 +557,7 @@ # Test that nano time clock is available. # CHECK-LABEL: TEST: testDumpToObjectFile def testDumpToObjectFile(): - _, object_path = tempfile.mkstemp(suffix=".o") + fd, object_path = tempfile.mkstemp(suffix=".o") try: with Context(): @@ -585,6 +585,7 @@ print(f"Object file is empty: {os.path.getsize(object_path) == 0}") finally: + os.close(fd) os.remove(object_path)