[libc++] Make sure temporary config files are closed
authorLouis Dionne <ldionne@apple.com>
Tue, 28 Apr 2020 21:12:18 +0000 (17:12 -0400)
committerLouis Dionne <ldionne@apple.com>
Tue, 28 Apr 2020 21:13:03 +0000 (17:13 -0400)
Otherwise, trying to remove the file triggers an error on Windows.

libcxx/utils/libcxx/test/dsl.py

index 9c0d68e..452e4b4 100644 (file)
@@ -39,6 +39,7 @@ def _makeConfigTest(config):
   if not os.path.exists(sourceRoot):
     os.makedirs(sourceRoot)
   tmp = tempfile.NamedTemporaryFile(dir=sourceRoot, delete=False)
+  tmp.close()
   pathInSuite = [os.path.relpath(tmp.name, sourceRoot)]
   class TestWrapper(lit.Test.Test):
     def __enter__(self):       return self