mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-05 17:00:58 +01:00
fixed segfault regression
This commit is contained in:
parent
95052761b5
commit
ec3882b987
2 changed files with 26 additions and 1 deletions
14
news/sig.rst
Normal file
14
news/sig.rst
Normal file
|
@ -0,0 +1,14 @@
|
|||
**Added:** None
|
||||
|
||||
**Changed:** None
|
||||
|
||||
**Deprecated:** None
|
||||
|
||||
**Removed:** None
|
||||
|
||||
**Fixed:**
|
||||
|
||||
* Segfaults and other early exit signals are now reported correctly,
|
||||
again.
|
||||
|
||||
**Security:** None
|
|
@ -872,6 +872,16 @@ class PopenThread(threading.Thread):
|
|||
"""Process return code."""
|
||||
return self.proc.returncode
|
||||
|
||||
@property
|
||||
def signal(self):
|
||||
"""Process signal, or None."""
|
||||
s = getattr(self.proc, "signal", None)
|
||||
if s is None:
|
||||
rtn = self.returncode
|
||||
if rtn is not None and rtn != 0:
|
||||
s = (-1*rtn, os.WCOREDUMP(rtn))
|
||||
return s
|
||||
|
||||
def send_signal(self, signal):
|
||||
"""Dispatches to Popen.send_signal()."""
|
||||
dt = 0.0
|
||||
|
@ -1982,7 +1992,8 @@ class CommandPipeline:
|
|||
if core:
|
||||
sig_str += ' (core dumped)'
|
||||
print(sig_str, file=sys.stderr)
|
||||
self.errors += sig_str + '\n'
|
||||
if self.errors is not None:
|
||||
self.errors += sig_str + '\n'
|
||||
|
||||
def _apply_to_history(self):
|
||||
"""Applies the results to the current history object."""
|
||||
|
|
Loading…
Add table
Reference in a new issue