MCPcopy Create free account
hub / github.com/agent0ai/agent-zero / _on_data

Function _on_data

plugins/_code_execution/helpers/tty_session.py:270–285  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

268 pass
269
270 def _on_data():
271 cur = master_ref.get("fd")
272 if cur is None:
273 reader.feed_eof()
274 return
275 try:
276 data = os.read(cur, 1 << 16)
277 except OSError as e:
278 if e.errno != errno.EIO: # EIO == EOF on some systems
279 raise
280 data = b""
281 if data:
282 reader.feed_data(data)
283 else:
284 reader.feed_eof()
285 _release_master_fd()
286
287 loop.add_reader(master, _on_data)
288

Callers 1

_spawn_winptyFunction · 0.85

Calls 4

_release_master_fdFunction · 0.85
getMethod · 0.45
readMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected