From 4f7d12f3fd071092d6bd03601d0de51f8b4ac883 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Sat, 26 Oct 2019 00:59:45 +0200 Subject: [PATCH] Fix error when two linker processes fail When a linker process fails, `failed` will be set to a value other than `None`. When a second linker process fails, the `else` case will be taken because `failed is None`, which executes `compile_cmd.on_success()`. This function tries to rename or move the file generated by the linker but since the linker process failed, the file will most likely not exist. This will throw an error, which will prevent printing the actual error message from the linker. --- setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 257727cb5..224231191 100755 --- a/setup.py +++ b/setup.py @@ -379,8 +379,9 @@ def parallel_run(items): return pid, s = os.wait() compile_cmd, w = workers.pop(pid, (None, None)) - if compile_cmd is not None and ((s & 0xff) != 0 or ((s >> 8) & 0xff) != 0) and failed is None: - failed = compile_cmd + if compile_cmd is not None and ((s & 0xff) != 0 or ((s >> 8) & 0xff) != 0): + if failed is None: + failed = compile_cmd elif compile_cmd.on_success is not None: compile_cmd.on_success()