Browse Source

Merge remote-tracking branch 'origin/develop' into xap

QMK Bot 2 years ago
parent
commit
9e9f7d8f1a
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/python/qmk/commands.py

+ 3 - 1
lib/python/qmk/commands.py

@@ -110,7 +110,9 @@ def dump_lines(output_file, lines, quiet=True):
         output_file.parent.mkdir(parents=True, exist_ok=True)
         if output_file.exists():
             output_file.replace(output_file.parent / (output_file.name + '.bak'))
-        output_file.write_text(generated, encoding='utf-8')
+        with open(output_file, 'w', encoding='utf-8', newline='\n') as f:
+            f.write(generated)
+        # output_file.write_text(generated, encoding='utf-8', newline='\n') # `newline` needs Python 3.10
 
         if not quiet:
             cli.log.info(f'Wrote {output_file.name} to {output_file}.')