From 27eb30b2fceccc1bde9bd6b76638603dda460ba8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 15 Jun 2022 12:59:06 -0400 Subject: lv2specgen: Use scoped file handles --- lv2specgen/lv2docgen.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lv2specgen/lv2docgen.py') diff --git a/lv2specgen/lv2docgen.py b/lv2specgen/lv2docgen.py index 23a239d..d620a34 100755 --- a/lv2specgen/lv2docgen.py +++ b/lv2specgen/lv2docgen.py @@ -133,6 +133,5 @@ if __name__ == '__main__': raise print('Writing <%s> documentation to %s' % (plugin, outpath)) - out = open(outpath, 'w') - out.write(html) - out.close() + with open(outpath, 'w') as out: + out.write(html) -- cgit v1.2.1