scripts: fix file writing in convert-spdx-licenses

Message ID 20220222144534.2244338-1-scott.murray@konsulko.com
State Accepted, archived
Commit 46135c87345c7189053dafbed92c754f9f328c32
Headers show
Series scripts: fix file writing in convert-spdx-licenses | expand

Commit Message

Scott Murray Feb. 22, 2022, 2:45 p.m. UTC
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>
---
 scripts/contrib/convert-spdx-licenses.py | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/scripts/contrib/convert-spdx-licenses.py b/scripts/contrib/convert-spdx-licenses.py
index 68b9e2f18e..4e194dee3f 100755
--- a/scripts/contrib/convert-spdx-licenses.py
+++ b/scripts/contrib/convert-spdx-licenses.py
@@ -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)