X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/e8aadedd970140a840e8120bd36e8df52cc26ed2..12f98219bc83fa186cc97db7b614dccfb2a1db71:/src/black_primer/lib.py diff --git a/src/black_primer/lib.py b/src/black_primer/lib.py index c306981..39ae93b 100644 --- a/src/black_primer/lib.py +++ b/src/black_primer/lib.py @@ -58,13 +58,16 @@ async def _gen_check_output( await process.wait() raise - if process.returncode != 0: - returncode = process.returncode - if returncode is None: - returncode = 69 + # A non-optional timeout was supplied to asyncio.wait_for, guaranteeing + # a timeout or completed process. A terminated Python process will have a + # non-empty returncode value. + assert process.returncode is not None + if process.returncode != 0: cmd_str = " ".join(cmd) - raise CalledProcessError(returncode, cmd_str, output=stdout, stderr=stderr) + raise CalledProcessError( + process.returncode, cmd_str, output=stdout, stderr=stderr + ) return (stdout, stderr)