Skip to contentSkip to conversation

scripts: fix file writing in convert-spdx-licenses

PATCH New Scott Murray 1 participant 1 message Feb 22, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts: fix file writing in convert-spdx-licenses

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.

---
 scripts/contrib/convert-spdx-licenses.py | 1 +
 1 file changed, 1 insertion(+)
scripts/contrib/convert-spdx-licenses.py +1 -0
index 68b9e2f18e..4e194dee3f 100755
@@ -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)
Signature · 1 line
2.35.1