mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 20:08:06 +02:00
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:
parent
ede03c99db
commit
3395b40b37
1 changed files with 1 additions and 2 deletions
|
|
@ -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.')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue