Skip to content

Commit 00c40d9

Browse files
committed
Remove extraneous endlines in rendered output.
1 parent f6d8780 commit 00c40d9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cppimport/templating.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,8 @@ def run_templating(module_data):
5959
print(mako.exceptions.text_error_template().render())
6060

6161
rendered_src_filepath = get_rendered_source_filepath(filepath)
62-
open(rendered_src_filepath, 'w').write(buf.getvalue())
62+
63+
with open(rendered_src_filepath, 'w', newline = '') as f:
64+
f.write(buf.getvalue())
65+
6366
module_data['rendered_src_filepath'] = rendered_src_filepath

0 commit comments

Comments
 (0)