diff --git a/avocado/utils/process.py b/avocado/utils/process.py index 6e9e864a2185075ef88132e542467e769fc187a2..8b589c4b78415a2a962213b36be7dbcea01b00f4 100644 --- a/avocado/utils/process.py +++ b/avocado/utils/process.py @@ -563,12 +563,16 @@ class SubProcess(object): :returns: The command result object. :rtype: A :class:`CmdResult` instance. """ + def timeout_handler(): + self.send_signal(sig) + self.result.interrupted = "timeout after %ss" % timeout + self._init_subprocess() if timeout is None: self.wait() elif timeout > 0.0: - timer = threading.Timer(timeout, self.send_signal, [sig]) + timer = threading.Timer(timeout, timeout_handler) try: timer.start() self.wait()