From 89240571d49e8374cb99bad34a2e7cc1bededcc9 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 25 Oct 2017 18:22:54 +0200 Subject: [PATCH] py3: socket.error is deprecated --- lib/util.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/util.py b/lib/util.py index abe656f4..1e573986 100644 --- a/lib/util.py +++ b/lib/util.py @@ -676,18 +676,10 @@ class SocketPipe: print_error("SSLError:", e) time.sleep(0.1) continue - except socket.error as e: - if e[0] in (errno.EWOULDBLOCK,errno.EAGAIN): - print_error("EAGAIN: retrying") - time.sleep(0.1) - continue - elif e[0] in ['timed out', 'The write operation timed out']: - print_error("socket timeout, retry") - time.sleep(0.1) - continue - else: - traceback.print_exc(file=sys.stdout) - raise e + except OSError as e: + print_error("OSError", e) + time.sleep(0.1) + continue class QueuePipe: