mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 19:06:15 +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:
|
||||
tmpfilename = tmpfile.name
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user