From cd240a05f4305900cac6f18067b92abd9cfe2c94 Mon Sep 17 00:00:00 2001 From: KENZ Date: Sat, 18 Jun 2022 11:35:30 +0900 Subject: [PATCH] Let codegen to write LF newlines on Windows --- codegen2.py | 2 +- gen_constants_rs.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codegen2.py b/codegen2.py index b74d2105..d8a50937 100644 --- a/codegen2.py +++ b/codegen2.py @@ -39,7 +39,7 @@ def generate_library(classes, config, libname): is_rust = path.endswith('.rs') if libname: path = 'wx-%s/%s' % (libname, path) - with open(path, 'w') as f: + with open(path, 'w', newline='\n') as f: for chunk in generator( rust_bindings if is_rust else cxx_bindings, libname diff --git a/gen_constants_rs.py b/gen_constants_rs.py index f20ac557..4bed4281 100644 --- a/gen_constants_rs.py +++ b/gen_constants_rs.py @@ -20,7 +20,7 @@ # place wxWidgets doxygen xml files in wxml/ dir and run this. def main(): outpath = 'wx-base/src/constants.rs' - with open(outpath, 'w') as f: + with open(outpath, 'w', newline='\n') as f: print(PROLOGUE, file=f) for file in xml_files_in('wxml/'): # print(file)