mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Always close .buildinfo file after reading.
This commit is contained in:
parent
3d4b8830a0
commit
f250397f77
@ -159,6 +159,7 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
old_config_hash = old_tags_hash = ''
|
old_config_hash = old_tags_hash = ''
|
||||||
try:
|
try:
|
||||||
fp = open(path.join(self.outdir, '.buildinfo'))
|
fp = open(path.join(self.outdir, '.buildinfo'))
|
||||||
|
try:
|
||||||
version = fp.readline()
|
version = fp.readline()
|
||||||
if version.rstrip() != '# Sphinx build info version 1':
|
if version.rstrip() != '# Sphinx build info version 1':
|
||||||
raise ValueError
|
raise ValueError
|
||||||
@ -169,6 +170,7 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
tag, old_tags_hash = fp.readline().strip().split(': ')
|
tag, old_tags_hash = fp.readline().strip().split(': ')
|
||||||
if tag != 'tags':
|
if tag != 'tags':
|
||||||
raise ValueError
|
raise ValueError
|
||||||
|
finally:
|
||||||
fp.close()
|
fp.close()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.warn('unsupported build info format in %r, building all' %
|
self.warn('unsupported build info format in %r, building all' %
|
||||||
|
Loading…
Reference in New Issue
Block a user