diff options
Diffstat (limited to 'test/py/u_boot_spawn.py')
-rw-r--r-- | test/py/u_boot_spawn.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py index 3d9cde5ee0..a5f4a8e91b 100644 --- a/test/py/u_boot_spawn.py +++ b/test/py/u_boot_spawn.py @@ -56,8 +56,12 @@ class Spawn(object): finally: os._exit(255) - self.poll = select.poll() - self.poll.register(self.fd, select.POLLIN | select.POLLPRI | select.POLLERR | select.POLLHUP | select.POLLNVAL) + try: + self.poll = select.poll() + self.poll.register(self.fd, select.POLLIN | select.POLLPRI | select.POLLERR | select.POLLHUP | select.POLLNVAL) + except: + self.close() + raise def kill(self, sig): """Send unix signal "sig" to the child process. |