Commit 6aeca89
committed
Support system_raise_on_error in ZMQInteractiveShell
Add support for IPython's system_raise_on_error configuration option
in ZMQInteractiveShell.system_piped() override.
This complements the IPython PR that adds the system_raise_on_error
config option (see ipython/ipython PR). Since ZMQInteractiveShell
overrides system_piped() for Windows UNC path handling, it needs to
also check the system_raise_on_error config and raise CalledProcessError
on non-zero exit status.
Changes:
- Import CalledProcessError from subprocess
- Capture exit_code from system() call
- Raise CalledProcessError when system_raise_on_error is True
and exit_code is non-zero
This enables Jupyter notebook users to halt execution on shell
command failures when they opt-in via:
get_ipython().system_raise_on_error = True1 parent c80f2d4 commit 6aeca89
1 file changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
783 | 784 | | |
784 | 785 | | |
785 | 786 | | |
786 | | - | |
| 787 | + | |
| 788 | + | |
787 | 789 | | |
788 | | - | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
789 | 796 | | |
790 | 797 | | |
791 | 798 | | |
| |||
0 commit comments