From 503ad506f919b425f7812f08615eb5c6af00f63c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 9 Aug 2022 16:32:05 -0400 Subject: Fix syntax check on Windows --- scripts/lv2_check_syntax.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/lv2_check_syntax.py b/scripts/lv2_check_syntax.py index d1b72dc..391e4e1 100755 --- a/scripts/lv2_check_syntax.py +++ b/scripts/lv2_check_syntax.py @@ -57,12 +57,15 @@ def run(serdi, filenames): for filename in filenames: rel_path = os.path.relpath(filename) - with tempfile.NamedTemporaryFile(mode="w") as out: + with tempfile.NamedTemporaryFile(mode="w", delete=False) as out: + out_name = out.name command = [serdi, "-o", "turtle", rel_path] subprocess.check_call(command, stdout=out) - if _check_file_equals(rel_path, out.name): - status = 1 + if _check_file_equals(rel_path, out_name): + status = 1 + + os.remove(out_name) return status -- cgit v1.2.1