pexpect: Check for signalstatus being none

This would happen if e.g. the child shell did `exit 1` before an
`expect()`.
This commit is contained in:
Fabian Boehm
2024-03-12 22:04:23 +01:00
parent 0aa2426552
commit 360342bb9e

View File

@@ -253,7 +253,7 @@ class SpawnedProc(object):
failtype = pexpect_error_type(err)
# If we get an EOF, we check if the process exited with a signal.
# This shows us e.g. if it crashed
if failtype == 'EOF' and self.spawn.signalstatus != 0:
if failtype == 'EOF' and self.spawn.signalstatus is not None and self.spawn.signalstatus != 0:
failtype = "SIGNAL " + Signals(self.spawn.signalstatus).name
fmtkeys = {"failtype": failtype, "pat": escape(pat)}