mirror of
https://github.com/mpv-player/mpv
synced 2025-02-16 20:27:23 +00:00
TOOLS/docutils-wrapper: gracefully remove non-existing files
This commit is contained in:
parent
892ca9f5d9
commit
d6f70ef96b
@ -39,6 +39,12 @@ def convert_depfile(output, depfile):
|
|||||||
f.write(os.path.abspath(dep))
|
f.write(os.path.abspath(dep))
|
||||||
f.write(' \\\n')
|
f.write(' \\\n')
|
||||||
|
|
||||||
|
def remove(path):
|
||||||
|
try:
|
||||||
|
os.remove(path)
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
argv = sys.argv[1:]
|
argv = sys.argv[1:]
|
||||||
|
|
||||||
depfile = None
|
depfile = None
|
||||||
@ -52,5 +58,5 @@ try:
|
|||||||
subprocess.run(argv)
|
subprocess.run(argv)
|
||||||
convert_depfile(output, depfile)
|
convert_depfile(output, depfile)
|
||||||
except:
|
except:
|
||||||
os.remove(output)
|
remove(output)
|
||||||
os.remove(depfile)
|
remove(depfile)
|
||||||
|
Loading…
Reference in New Issue
Block a user