diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2014-02-01 22:28:07 +0100 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2014-02-01 22:28:07 +0100 |
| commit | a0fa9d04f2b15508fd004e8002bc9537332170c7 (patch) | |
| tree | c6d01866be1fd3a7d7d4c2b550c19ddb7ca95cee /asyncio/base_subprocess.py | |
| parent | cc48ba82a0645f458e30b25e996fcbb0f3a7de15 (diff) | |
| download | trollius-git-a0fa9d04f2b15508fd004e8002bc9537332170c7.tar.gz | |
Remove STDIN, STDOUT and STDERR from base_subprocess and unix_events
Diffstat (limited to 'asyncio/base_subprocess.py')
| -rw-r--r-- | asyncio/base_subprocess.py | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/asyncio/base_subprocess.py b/asyncio/base_subprocess.py index b7cdbce..b78f816 100644 --- a/asyncio/base_subprocess.py +++ b/asyncio/base_subprocess.py @@ -6,11 +6,6 @@ from . import tasks from . import transports -STDIN = 0 -STDOUT = 1 -STDERR = 2 - - class BaseSubprocessTransport(transports.SubprocessTransport): def __init__(self, loop, protocol, args, shell, @@ -22,11 +17,11 @@ class BaseSubprocessTransport(transports.SubprocessTransport): self._pipes = {} if stdin == subprocess.PIPE: - self._pipes[STDIN] = None + self._pipes[0] = None if stdout == subprocess.PIPE: - self._pipes[STDOUT] = None + self._pipes[1] = None if stderr == subprocess.PIPE: - self._pipes[STDERR] = None + self._pipes[2] = None self._pending_calls = collections.deque() self._finished = False self._returncode = None @@ -76,19 +71,19 @@ class BaseSubprocessTransport(transports.SubprocessTransport): loop = self._loop if proc.stdin is not None: _, pipe = yield from loop.connect_write_pipe( - lambda: WriteSubprocessPipeProto(self, STDIN), + lambda: WriteSubprocessPipeProto(self, 0), proc.stdin) - self._pipes[STDIN] = pipe + self._pipes[0] = pipe if proc.stdout is not None: _, pipe = yield from loop.connect_read_pipe( - lambda: ReadSubprocessPipeProto(self, STDOUT), + lambda: ReadSubprocessPipeProto(self, 1), proc.stdout) - self._pipes[STDOUT] = pipe + self._pipes[1] = pipe if proc.stderr is not None: _, pipe = yield from loop.connect_read_pipe( - lambda: ReadSubprocessPipeProto(self, STDERR), + lambda: ReadSubprocessPipeProto(self, 2), proc.stderr) - self._pipes[STDERR] = pipe + self._pipes[2] = pipe assert self._pending_calls is not None |
