summaryrefslogtreecommitdiff
path: root/giscanner/docmain.py
diff options
context:
space:
mode:
Diffstat (limited to 'giscanner/docmain.py')
-rw-r--r--giscanner/docmain.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/giscanner/docmain.py b/giscanner/docmain.py
index fdcda18f..b5baf99e 100644
--- a/giscanner/docmain.py
+++ b/giscanner/docmain.py
@@ -60,9 +60,8 @@ def doc_main(args):
if args.write_sections:
sections_file = generate_sections_file(transformer)
- fp = open(args.output, 'w')
- write_sections_file(fp, sections_file)
- fp.close()
+ with open(args.output, 'w') as fp:
+ write_sections_file(fp, sections_file)
else:
writer = DocWriter(transformer, args.language)
writer.write(args.output)