Commit 77e62252 authored by Anael Beutot's avatar Anael Beutot
Browse files

Fix errno 3 when stopping host handler.

parent 559fef53
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
import os
import sys
import pty
import errno
import fcntl
import subprocess
import logging
@@ -181,7 +182,12 @@ class Handler(BasePlugin):
    def stop(self):
        # kill all currently running shells
        for shell in self.shells.values():
            try:
                shell.kill()
            except OSError as exc:
                if exc.errno != errno.ESRCH:
                    raise
                # process does not exists
            shell.close_cb()
        self.shells.clear()
        BasePlugin.stop(self)