Skip to content

Commit 6e229f2

Browse files
committed
Handle select errors when closing Zeroconf
Based on a pull request by someposer[1] (code adapted to work on Python 3). Fixes two pychromecast issues[2][3]. [1] python-zeroconf#88 [2] home-assistant-libs/pychromecast#59 [3] home-assistant-libs/pychromecast#120
1 parent 0a5ea31 commit 6e229f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zeroconf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,10 +1106,10 @@ def run(self):
11061106
if reader:
11071107
reader.handle_read(socket_)
11081108

1109-
except socket.error as e:
1109+
except (select.error, socket.error) as e:
11101110
# If the socket was closed by another thread, during
11111111
# shutdown, ignore it and exit
1112-
if e.errno != socket.EBADF or not self.zc.done:
1112+
if e.args[0] != socket.EBADF or not self.zc.done:
11131113
raise
11141114

11151115
def add_reader(self, reader, socket_):

0 commit comments

Comments
 (0)