diff --git a/zeroconf.py b/zeroconf.py index 5fad7109..75f4a793 100644 --- a/zeroconf.py +++ b/zeroconf.py @@ -1115,10 +1115,10 @@ def run(self): if reader: reader.handle_read(socket_) - except socket.error as e: + except (select.error, socket.error) as e: # If the socket was closed by another thread, during # shutdown, ignore it and exit - if e.errno != socket.EBADF or not self.zc.done: + if e[0] != socket.EBADF or not self.zc.done: raise def add_reader(self, reader, socket_):