From: Amit Bawer <abawer.com(a)gmail.com>
Replace socket.error with EnvironmentError exception class
co-authored with Nir Soffer <nsoffer(a)redhat.com>
Signed-off-by: Amit Bawer <abawer(a)redhat.com>
---
tests/util.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/util.py b/tests/util.py
index 0695d8c..8bb4f9f 100644
--- a/tests/util.py
+++ b/tests/util.py
@@ -61,12 +61,12 @@ def wait_for_daemon(timeout):
try:
while True:
try:
s.connect(path)
return
- except socket.error as e:
- if e[0] not in (errno.ECONNREFUSED, errno.ENOENT):
+ except EnvironmentError as e:
+ if e.errno not in (errno.ECONNREFUSED, errno.ENOENT):
raise # Unexpected error
if time.time() > deadline:
raise TimeoutExpired
time.sleep(0.05)
finally:
--
2.17.2