mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
Exitcode (#3465)
This commit is contained in:
parent
b37675a6e8
commit
2e30f330c0
3 changed files with 34 additions and 1 deletions
25
news/exitcode.rst
Normal file
25
news/exitcode.rst
Normal file
|
@ -0,0 +1,25 @@
|
|||
**Added:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Changed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Deprecated:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Removed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Fixed:**
|
||||
|
||||
* Fixed issue where negative exit codes (such as those produced
|
||||
by core dumps) where treated as logical successes when chaining
|
||||
processes with other boolean expressions.
|
||||
|
||||
**Security:**
|
||||
|
||||
* <news item>
|
|
@ -559,3 +559,11 @@ def test_pipe_between_subprocs(cmd, fmt, exp):
|
|||
"verify pipe between subprocesses doesn't throw an exception"
|
||||
check_run_xonsh(cmd, fmt, exp)
|
||||
|
||||
|
||||
@skip_if_on_windows
|
||||
def test_negative_exit_codes_fail():
|
||||
# see issue 3309
|
||||
script = 'python -c "import os; os.abort()" && echo OK\n'
|
||||
out, err, rtn = run_xonsh(script)
|
||||
assert "OK" is not out
|
||||
assert "OK" is not err
|
||||
|
|
|
@ -2288,7 +2288,7 @@ class CommandPipeline:
|
|||
rtn = self.returncode
|
||||
if (
|
||||
rtn is not None
|
||||
and rtn > 0
|
||||
and rtn != 0
|
||||
and builtins.__xonsh__.env.get("RAISE_SUBPROC_ERROR")
|
||||
):
|
||||
try:
|
||||
|
|
Loading…
Add table
Reference in a new issue