summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
Diffstat (limited to 'TOOLS')
-rwxr-xr-xTOOLS/docutils-wrapper.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/TOOLS/docutils-wrapper.py b/TOOLS/docutils-wrapper.py
index 9d6304fc45..ff2757a1d8 100755
--- a/TOOLS/docutils-wrapper.py
+++ b/TOOLS/docutils-wrapper.py
@@ -39,6 +39,12 @@ def convert_depfile(output, depfile):
f.write(os.path.abspath(dep))
f.write(' \\\n')
+def remove(path):
+ try:
+ os.remove(path)
+ except FileNotFoundError:
+ pass
+
argv = sys.argv[1:]
depfile = None
@@ -52,5 +58,5 @@ try:
subprocess.run(argv)
convert_depfile(output, depfile)
except:
- os.remove(output)
- os.remove(depfile)
+ remove(output)
+ remove(depfile)