intel/genxml: use Path.replace instead of unlink and rename

Suggested-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18955>
This commit is contained in:
Dylan Baker
2022-10-12 10:18:38 -07:00
parent ede03c99db
commit 3395b40b37
+1 -2
View File
@@ -189,8 +189,7 @@ def main() -> None:
tmp = filename.with_suffix(f'{filename.suffix}.tmp')
et.indent(xml, space=' ')
xml.write(tmp, encoding="utf-8", xml_declaration=True)
filename.unlink()
tmp.rename(filename)
tmp.replace(filename)
if not args.quiet:
print('done.')