MCPcopy Index your code
hub / github.com/python/cpython / pipe_connection_lost

Method pipe_connection_lost

Lib/asyncio/subprocess.py:74–102  ·  view source on GitHub ↗
(self, fd, exc)

Source from the content-addressed store, hash-verified

72 reader.feed_data(data)
73
74 def pipe_connection_lost(self, fd, exc):
75 if fd == 0:
76 pipe = self.stdin
77 if pipe is not None:
78 pipe.close()
79 self.connection_lost(exc)
80 if exc is None:
81 self._stdin_closed.set_result(None)
82 else:
83 self._stdin_closed.set_exception(exc)
84 # Since calling `wait_closed()` is not mandatory,
85 # we shouldn't log the traceback if this is not awaited.
86 self._stdin_closed._log_traceback = False
87 return
88 if fd == 1:
89 reader = self.stdout
90 elif fd == 2:
91 reader = self.stderr
92 else:
93 reader = None
94 if reader is not None:
95 if exc is None:
96 reader.feed_eof()
97 else:
98 reader.set_exception(exc)
99
100 if fd in self._pipe_fds:
101 self._pipe_fds.remove(fd)
102 self._maybe_close_transport()
103
104 def process_exited(self):
105 self._process_exited = True

Callers

nothing calls this directly

Calls 7

feed_eofMethod · 0.80
closeMethod · 0.45
connection_lostMethod · 0.45
set_resultMethod · 0.45
set_exceptionMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected