mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
make robust for tests
This commit is contained in:
parent
3597da1bba
commit
69df412445
1 changed files with 8 additions and 2 deletions
|
@ -827,7 +827,10 @@ class PopenThread(threading.Thread):
|
|||
def _disable_suspend_keybind(self):
|
||||
if ON_WINDOWS:
|
||||
return
|
||||
mode = termios.tcgetattr(0) # only makes sense for stdin
|
||||
try:
|
||||
mode = termios.tcgetattr(0) # only makes sense for stdin
|
||||
except termios.error:
|
||||
return
|
||||
self._tc_cc_vsusp = mode[CC][termios.VSUSP]
|
||||
mode[CC][termios.VSUSP] = b'\x00' # set ^Z (ie SIGSTOP) to undefined
|
||||
termios.tcsetattr(0, termios.TCSANOW, mode)
|
||||
|
@ -835,7 +838,10 @@ class PopenThread(threading.Thread):
|
|||
def _restore_suspend_keybind(self):
|
||||
if ON_WINDOWS:
|
||||
return
|
||||
mode = termios.tcgetattr(0) # only makes sense for stdin
|
||||
try:
|
||||
mode = termios.tcgetattr(0) # only makes sense for stdin
|
||||
except termios.error:
|
||||
return
|
||||
mode[CC][termios.VSUSP] = self._tc_cc_vsusp # set ^Z (ie SIGSTOP) to original
|
||||
try:
|
||||
# this usually doesn't work in interactive mode,
|
||||
|
|
Loading…
Add table
Reference in a new issue