diff options
author | Simon Warta <[email protected]> | 2017-04-09 20:36:43 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2017-04-18 09:36:25 +0200 |
commit | 27bd9e8f67f64174c6796267a592bec06ab38455 (patch) | |
tree | 82671c0c3c294c48ebab9f6d8f9924b437b37287 /configure.py | |
parent | 96ee2eaba55b3cff1252bd68c135d440e48d1615 (diff) |
Simplify file opening in write_template()
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/configure.py b/configure.py index 977859660..44d53f5bd 100755 --- a/configure.py +++ b/configure.py @@ -2741,11 +2741,8 @@ def main(argv=None): logging.error('Error while creating "%s": %s' % (build_dir, e)) def write_template(sink, template): - try: - f = open(sink, 'w') + with open(sink, 'w') as f: f.write(process_template(template, template_vars)) - finally: - f.close() def in_build_dir(p): return os.path.join(build_config.build_dir, p) |