(self, loop, protocol, args, shell,
stdin, stdout, stderr, bufsize,
waiter=None, extra=None, **kwargs)
| 13 | class BaseSubprocessTransport(transports.SubprocessTransport): |
| 14 | |
| 15 | def __init__(self, loop, protocol, args, shell, |
| 16 | stdin, stdout, stderr, bufsize, |
| 17 | waiter=None, extra=None, **kwargs): |
| 18 | super().__init__(extra) |
| 19 | self._closed = False |
| 20 | self._protocol = protocol |
| 21 | self._loop = loop |
| 22 | self._proc = None |
| 23 | self._pid = None |
| 24 | self._returncode = None |
| 25 | self._exit_waiters = [] |
| 26 | self._pending_calls = collections.deque() |
| 27 | self._pipes = {} |
| 28 | self._finished = False |
| 29 | self._pipes_connected = False |
| 30 | |
| 31 | if stdin == subprocess.PIPE: |
| 32 | self._pipes[0] = None |
| 33 | if stdout == subprocess.PIPE: |
| 34 | self._pipes[1] = None |
| 35 | if stderr == subprocess.PIPE: |
| 36 | self._pipes[2] = None |
| 37 | |
| 38 | # Create the child process: set the _proc attribute |
| 39 | try: |
| 40 | self._start(args=args, shell=shell, stdin=stdin, stdout=stdout, |
| 41 | stderr=stderr, bufsize=bufsize, **kwargs) |
| 42 | except: |
| 43 | self.close() |
| 44 | raise |
| 45 | |
| 46 | self._pid = self._proc.pid |
| 47 | self._extra['subprocess'] = self._proc |
| 48 | |
| 49 | if self._loop.get_debug(): |
| 50 | if isinstance(args, (bytes, str)): |
| 51 | program = args |
| 52 | else: |
| 53 | program = args[0] |
| 54 | logger.debug('process %r created: pid %s', |
| 55 | program, self._pid) |
| 56 | |
| 57 | self._loop.create_task(self._connect_pipes(waiter)) |
| 58 | |
| 59 | def __repr__(self): |
| 60 | info = [self.__class__.__name__] |
nothing calls this directly
no test coverage detected