mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 15:56:23 +01:00
mkenums: Don't raise when unlinking a file that does not exist
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=789637
This commit is contained in:
parent
d31a7516a9
commit
34148fc9b9
@ -708,5 +708,11 @@ write_output("\n" + comment + "\n")
|
|||||||
if tmpfile is not None:
|
if tmpfile is not None:
|
||||||
tmpfilename = tmpfile.name
|
tmpfilename = tmpfile.name
|
||||||
tmpfile.close()
|
tmpfile.close()
|
||||||
os.unlink(options.output)
|
|
||||||
|
try:
|
||||||
|
os.unlink(options.output)
|
||||||
|
except OSError as error:
|
||||||
|
if error.errno != errno.ENOENT:
|
||||||
|
raise error
|
||||||
|
|
||||||
os.rename(tmpfilename, options.output)
|
os.rename(tmpfilename, options.output)
|
||||||
|
Loading…
Reference in New Issue
Block a user