MCPcopy Index your code
hub / github.com/ipython/ipython / read_no_interrupt

Function read_no_interrupt

IPython/utils/_process_common.py:32–45  ·  view source on GitHub ↗

Read from a pipe ignoring EINTR errors. This is necessary because when reading from pipes with GUI event loops running in the background, often interrupts are raised that stop the command from completing.

(stream: IO[bytes])

Source from the content-addressed store, hash-verified

30#-----------------------------------------------------------------------------
31
32def read_no_interrupt(stream: IO[bytes]) -> bytes | None:
33 """Read from a pipe ignoring EINTR errors.
34
35 This is necessary because when reading from pipes with GUI event loops
36 running in the background, often interrupts are raised that stop the
37 command from completing."""
38 import errno
39
40 try:
41 return stream.read()
42 except IOError as err:
43 if err.errno != errno.EINTR:
44 raise
45 return None
46
47
48def process_handler(

Callers 2

stdout_readFunction · 0.85
stderr_readFunction · 0.85

Calls 1

readMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…