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.
This commit is contained in:
Luflosi 2019-10-26 00:59:45 +02:00
parent 62da158823
commit 4f7d12f3fd
No known key found for this signature in database
GPG Key ID: 14140F703B7D8362

View File

@ -379,8 +379,9 @@ def parallel_run(items):
return return
pid, s = os.wait() pid, s = os.wait()
compile_cmd, w = workers.pop(pid, (None, None)) 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: if compile_cmd is not None and ((s & 0xff) != 0 or ((s >> 8) & 0xff) != 0):
failed = compile_cmd if failed is None:
failed = compile_cmd
elif compile_cmd.on_success is not None: elif compile_cmd.on_success is not None:
compile_cmd.on_success() compile_cmd.on_success()