From 360342bb9e39d037d66c8a5b2e043baa6120e45e Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Tue, 12 Mar 2024 22:04:23 +0100 Subject: [PATCH] pexpect: Check for signalstatus being none This would happen if e.g. the child shell did `exit 1` before an `expect()`. --- build_tools/pexpect_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_tools/pexpect_helper.py b/build_tools/pexpect_helper.py index ca28ce7d4..05bee90b4 100644 --- a/build_tools/pexpect_helper.py +++ b/build_tools/pexpect_helper.py @@ -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)}