tools/replay: rmdir, not unlink for directories

And if the directory happens to be nonempty, well, maybe anyother
libinput reply is running so let's ignore that.

Fixes: cdfe34f62a ("replay: use the runtime quirks for our replay quirks")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1330>
This commit is contained in:
Peter Hutterer 2025-10-16 13:43:27 +10:00 committed by Marge Bot
parent f9977dba9c
commit 4b1bae3f8c

View file

@ -410,7 +410,13 @@ def main():
finally: finally:
if quirks_file: if quirks_file:
quirks_file.unlink() quirks_file.unlink()
quirks_file.parent.unlink() try:
quirks_file.parent.rmdir()
except OSError as e:
import errno
if e.errno != errno.ENOTEMPTY:
raise e
if __name__ == "__main__": if __name__ == "__main__":