diff options
Diffstat (limited to 'sphinx/builders/devhelp.py')
-rw-r--r-- | sphinx/builders/devhelp.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sphinx/builders/devhelp.py b/sphinx/builders/devhelp.py index 62e2c9843..eb3e997d8 100644 --- a/sphinx/builders/devhelp.py +++ b/sphinx/builders/devhelp.py @@ -127,8 +127,5 @@ class DevhelpBuilder(StandaloneHTMLBuilder): write_index(title, refs, subitems) # Dump the XML file - f = comp_open(path.join(outdir, outname + '.devhelp'), 'w') - try: + with comp_open(path.join(outdir, outname + '.devhelp'), 'w') as f: tree.write(f, 'utf-8') - finally: - f.close() |