From f4da81f749c5f3660c6dfeaab435c344c1005945 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Wed, 19 Oct 2016 22:05:25 +1300 Subject: pathoc: handle error when selecting on read file --- pathod/pathoc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pathod') diff --git a/pathod/pathoc.py b/pathod/pathoc.py index e3b4d1ae..e9fa5c43 100644 --- a/pathod/pathoc.py +++ b/pathod/pathoc.py @@ -121,7 +121,10 @@ class WebsocketFrameReader(basethread.BaseThread): while True: if self.ws_read_limit == 0: return - r, _, _ = select.select([self.rfile], [], [], 0.05) + try: + r, _, _ = select.select([self.rfile], [], [], 0.05) + except OSError: + return delta = time.time() - starttime if not r and self.timeout and delta > self.timeout: return -- cgit v1.2.3