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 A command to be executed in the system shell. Returns ------- None : we explicitly do NOT retur
(cmd: str)
| 545 | |
| 546 | |
| 547 | def system(cmd: str) -> None: |
| 548 | """Win32 version of os.system() that works with network shares. |
| 549 | |
| 550 | Note that this implementation returns None, as meant for use in IPython. |
| 551 | |
| 552 | Parameters |
| 553 | ---------- |
| 554 | cmd : str |
| 555 | A command to be executed in the system shell. |
| 556 | |
| 557 | Returns |
| 558 | ------- |
| 559 | None : we explicitly do NOT return the subprocess status code, as this |
| 560 | utility is meant to be used extensively in IPython, where any return value |
| 561 | would trigger : func:`sys.displayhook` calls. |
| 562 | """ |
| 563 | with AvoidUNCPath() as path: |
| 564 | if path is not None: |
| 565 | cmd = '"pushd %s &&"%s' % (path, cmd) |
| 566 | with Win32ShellCommandController(cmd) as scc: |
| 567 | scc.run() |
| 568 | |
| 569 | |
| 570 | if __name__ == "__main__": |
no test coverage detected
searching dependent graphs…