sconsDoxy: Restructure code: close file in case of exception.
Up to now, the file was opened, then DoxyfileParse() was invoked, then the file was closed. If DoxyfileParse() throws an exception, the file would not be closed. The new solution auto-closes the file in any case.
This commit is contained in:
parent
035a38b177
commit
ebf51f227c
1 changed files with 2 additions and 3 deletions
|
|
@ -107,9 +107,8 @@ def DoxyfileParse(file_contents, conf_dir, data=None):
|
|||
if nextfile in data[key]:
|
||||
raise Exception("recursive @INCLUDE in Doxygen config: " + nextfile)
|
||||
data[key].append(nextfile)
|
||||
fh = open(nextfile, "r")
|
||||
DoxyfileParse(fh.read(), conf_dir, data)
|
||||
fh.close()
|
||||
with open(nextfile, "r") as fh:
|
||||
DoxyfileParse(fh.read(), conf_dir, data)
|
||||
else:
|
||||
append_data(data, key, new_data, token)
|
||||
new_data = True
|
||||
|
|
|
|||
Loading…
Reference in a new issue