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

Method _run_script

IPython/core/magics/script.py:352–364  ·  view source on GitHub ↗

callback for running the script in the background

(self, p, cell, to_close)

Source from the content-addressed store, hash-verified

350 shebang.__skip_doctest__ = os.name != "posix"
351
352 async def _run_script(self, p, cell, to_close):
353 """callback for running the script in the background"""
354
355 p.stdin.write(cell)
356 await p.stdin.drain()
357 p.stdin.close()
358 await p.stdin.wait_closed()
359 await p.wait()
360 # asyncio read pipes have no close
361 # but we should drain the data anyway
362 for s in to_close:
363 await s.read()
364 self._gc_bg_processes()
365
366 @line_magic("killbgscripts")
367 def killbgscripts(self, _nouse_=''):

Callers 1

shebangMethod · 0.95

Calls 4

_gc_bg_processesMethod · 0.95
readMethod · 0.80
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected