summaryrefslogtreecommitdiff
path: root/mesonbuild/templates
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2025-01-06 12:23:02 -0800
committerDylan Baker <dylan@pnwbakers.com>2025-01-08 09:54:55 -0800
commitb94cbbfb79eaeaf863d77fca1dd051b102471ad3 (patch)
tree860da19843db802f2b72cb7db580cc0c66b56421 /mesonbuild/templates
parentb3d1b7af0707da946701f986e86c6e5421ae84e8 (diff)
downloadmeson-b94cbbfb79eaeaf863d77fca1dd051b102471ad3.tar.gz
templates: use a proper context manager with open
Diffstat (limited to 'mesonbuild/templates')
-rw-r--r--mesonbuild/templates/mesontemplates.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/templates/mesontemplates.py b/mesonbuild/templates/mesontemplates.py
index 83239648c..76f56a1a0 100644
--- a/mesonbuild/templates/mesontemplates.py
+++ b/mesonbuild/templates/mesontemplates.py
@@ -61,5 +61,6 @@ def create_meson_build(options: Arguments) -> None:
sourcespec=sourcespec,
depspec=depspec,
default_options=formatted_default_options)
- open('meson.build', 'w', encoding='utf-8').write(content)
+ with open('meson.build', 'w', encoding='utf-8') as f:
+ f.write(content)
print('Generated meson.build file:\n\n' + content)