From 4b1bae3f8c73b5875c6d0c6fe176396f75cee41f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 16 Oct 2025 13:43:27 +1000 Subject: [PATCH] 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: cdfe34f62a54 ("replay: use the runtime quirks for our replay quirks") Part-of: --- tools/libinput-replay.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/libinput-replay.py b/tools/libinput-replay.py index beb4dc24..b86ad1c6 100755 --- a/tools/libinput-replay.py +++ b/tools/libinput-replay.py @@ -410,7 +410,13 @@ def main(): finally: if quirks_file: 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__":