MCPcopy Create free account
hub / github.com/ipython/ipython / read_no_interrupt

Function read_no_interrupt

IPython/utils/_process_common.py:28–40  ·  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.

(p)

Source from the content-addressed store, hash-verified

26#-----------------------------------------------------------------------------
27
28def read_no_interrupt(p):
29 """Read from a pipe ignoring EINTR errors.
30
31 This is necessary because when reading from pipes with GUI event loops
32 running in the background, often interrupts are raised that stop the
33 command from completing."""
34 import errno
35
36 try:
37 return p.read()
38 except IOError as err:
39 if err.errno != errno.EINTR:
40 raise
41
42
43def process_handler(cmd, callback, stderr=subprocess.PIPE):

Callers 2

stdout_readFunction · 0.85
stderr_readFunction · 0.85

Calls 1

readMethod · 0.80

Tested by

no test coverage detected