If check=False is in the args then the run(..) function returns before execution has completed. I assume this is because CompletedProcess.returncode is a coroutine, so the calling thread doesn't block until it is accessed. When check=True this happens at the end of run(..).