Skip to content

Commit 445c366

Browse files
committed
Add support for IPython's system_raise_on_error
configuration option in ZMQInteractiveShell.system_piped() override. This complements IPython PR #15073 (ipython/ipython#15073) that adds the system_raise_on_error config option. 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.
1 parent d93f431 commit 445c366

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ipykernel/zmqshell.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -790,8 +790,7 @@ def system_piped(self, cmd):
790790
exit_code = system(self.var_expand(cmd, depth=1))
791791
self.user_ns["_exit_code"] = exit_code
792792

793-
# Raise an exception if the command failed and system_raise_on_error is True
794-
if self.system_raise_on_error and exit_code != 0:
793+
if getattr(self, 'system_raise_on_error', False) and exit_code != 0:
795794
raise CalledProcessError(exit_code, cmd)
796795

797796
# Ensure new system_piped implementation is used

0 commit comments

Comments
 (0)