]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts: fix file writing in convert-spdx-licenses
authorScott Murray <scott.murray@konsulko.com>
Tue, 22 Feb 2022 14:45:34 +0000 (09:45 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 22 Feb 2022 15:24:48 +0000 (15:24 +0000)
The convert-spdx-licenses.py script needs the same file closing
fix as was made to convert-variable-renames to ensure modified
file contents get flushed out.

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/contrib/convert-spdx-licenses.py

index 68b9e2f18e5a9adb06593288e9adaba65616cbb8..4e194dee3ff138ac058d176f0bc072c16961782f 100755 (executable)
@@ -114,6 +114,7 @@ def processfile(fn):
                     if orig != line:
                         modified = True
                     new_file.write(line)
+        new_file.close()
         if modified:
             shutil.copymode(fn, abs_path)
             os.remove(fn)