From 117d91b93fe007861d828d7e246aa6cd3e90054d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 20 Dec 2024 10:34:33 +1000 Subject: [PATCH] tools/libinput-replay: use list comprehension instead of append And remove the unnecessary del processes, we're in a block so processes ceases to exist there anyway. Part-of: --- tools/libinput-replay.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/libinput-replay.py b/tools/libinput-replay.py index 67ef28f8..3a9cfab0 100755 --- a/tools/libinput-replay.py +++ b/tools/libinput-replay.py @@ -278,10 +278,10 @@ def loop(args, recording): input("Hit enter to start replaying") try: - processes = [] - for d in devices: - p = multiprocessing.Process(target=wrap, args=(replay, d, args.verbose)) - processes.append(p) + processes = [ + multiprocessing.Process(target=wrap, args=(replay, d, args.verbose)) + for d in devices + ] for p in processes: p.start() @@ -289,8 +289,6 @@ def loop(args, recording): for p in processes: p.join() - del processes - if args.once: break except KeyboardInterrupt: