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

Function system

IPython/utils/_process_win32.py:116–139  ·  view source on GitHub ↗

Win32 version of os.system() that works with network shares. Note that this implementation returns None, as meant for use in IPython. Parameters ---------- cmd : str or list A command to be executed in the system shell. Returns ------- int : child process' exit

(cmd: str)

Source from the content-addressed store, hash-verified

114
115
116def system(cmd: str) -> Optional[int]:
117 """Win32 version of os.system() that works with network shares.
118
119 Note that this implementation returns None, as meant for use in IPython.
120
121 Parameters
122 ----------
123 cmd : str or list
124 A command to be executed in the system shell.
125
126 Returns
127 -------
128 int : child process' exit code.
129 """
130 # The controller provides interactivity with both
131 # stdin and stdout
132 # import _process_win32_controller
133 # _process_win32_controller.system(cmd)
134
135 with AvoidUNCPath() as path:
136 if path is not None:
137 cmd = '"pushd %s &&"%s' % (path, cmd)
138 res = process_handler(cmd, _system_body)
139 return res
140
141
142def getoutput(cmd: str) -> str:

Callers

nothing calls this directly

Calls 2

process_handlerFunction · 0.85
AvoidUNCPathClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…