diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-03-10 16:29:12 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-03-10 16:29:12 +0100 |
commit | 26c6fedd884e7b61ac397105d65e2d27984406f4 (patch) | |
tree | 83fe4976c88dae8cfc6c43f73342c136b6ee3582 | |
parent | e0bf949b1202883e4bd525fbdd9595558b3a634f (diff) | |
download | trollius-git-26c6fedd884e7b61ac397105d65e2d27984406f4.tar.gz |
Fix repr(BaseSubprocessTransport) if it didn't start yet
Replace "running" with "not started" and don't show the pid if the subprocess
didn't start yet.
-rw-r--r-- | asyncio/base_subprocess.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/asyncio/base_subprocess.py b/asyncio/base_subprocess.py index c1cdfda..d18f3e8 100644 --- a/asyncio/base_subprocess.py +++ b/asyncio/base_subprocess.py @@ -54,11 +54,14 @@ class BaseSubprocessTransport(transports.SubprocessTransport): info = [self.__class__.__name__] if self._closed: info.append('closed') - info.append('pid=%s' % self._pid) + if self._pid is not None: + info.append('pid=%s' % self._pid) if self._returncode is not None: info.append('returncode=%s' % self._returncode) - else: + elif self._pid is not None: info.append('running') + else: + info.append('not started') stdin = self._pipes.get(0) if stdin is not None: |