diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-05-26 00:27:07 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-05-26 00:50:57 +0900 |
commit | 698a715d0c905079b215034d04cb3f1d8e809dd5 (patch) | |
tree | b78c56a74ce3960214c6e51d775846c09e0d288f /sphinx/builders/devhelp.py | |
parent | ebc888d709ec8812bf6e158f919f6da23d38595c (diff) | |
download | sphinx-git-698a715d0c905079b215034d04cb3f1d8e809dd5.tar.gz |
Refactor code using ``with`` syntax
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 5ebaf2dc5..9f95de0e1 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() |