mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-06 09:20:57 +01:00
Merge pull request #2887 from laloch/sudo-permission-error
Fix exception when trying to send SIGSTOP to finished sudo child
This commit is contained in:
commit
a3a0bf9621
2 changed files with 9 additions and 2 deletions
|
@ -6,6 +6,10 @@
|
||||||
|
|
||||||
**Removed:** None
|
**Removed:** None
|
||||||
|
|
||||||
**Fixed:** None
|
**Fixed:**
|
||||||
|
|
||||||
|
* Fixed a bug which under very rare conditions could cause the shell
|
||||||
|
to die with PermissionError exception while sending SIGSTOP signal
|
||||||
|
to a child process.
|
||||||
|
|
||||||
**Security:** None
|
**Security:** None
|
||||||
|
|
|
@ -2419,7 +2419,10 @@ def pause_call_resume(p, f, *args, **kwargs):
|
||||||
hasattr(p, "send_signal") and ON_POSIX and not ON_MSYS and not ON_CYGWIN
|
hasattr(p, "send_signal") and ON_POSIX and not ON_MSYS and not ON_CYGWIN
|
||||||
)
|
)
|
||||||
if can_send_signal:
|
if can_send_signal:
|
||||||
p.send_signal(signal.SIGSTOP)
|
try:
|
||||||
|
p.send_signal(signal.SIGSTOP)
|
||||||
|
except PermissionError:
|
||||||
|
pass
|
||||||
try:
|
try:
|
||||||
f(*args, **kwargs)
|
f(*args, **kwargs)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
Loading…
Add table
Reference in a new issue