Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
a163f881
Commit
a163f881
authored
May 15, 2019
by
Dan
Committed by
Wenzel Jakob
Jun 11, 2019
Browse files
Delete partially-written file in the event of an error.
parent
ede328a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
tools/mkdoc.py
tools/mkdoc.py
+11
-2
No files found.
tools/mkdoc.py
View file @
a163f881
...
@@ -342,8 +342,17 @@ if __name__ == '__main__':
...
@@ -342,8 +342,17 @@ if __name__ == '__main__':
break
break
try
:
try
:
if
out_path
:
if
out_path
:
with
open
(
out_path
,
'w'
)
as
out_file
:
try
:
mkdoc
(
args
,
out_file
)
with
open
(
out_path
,
'w'
)
as
out_file
:
mkdoc
(
args
,
out_file
)
except
:
# In the event of an error, don't leave a partially-written
# output file.
try
:
os
.
unlink
(
out_path
)
except
:
pass
raise
else
:
else
:
mkdoc
(
args
)
mkdoc
(
args
)
except
NoFilenamesError
:
except
NoFilenamesError
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment