From 238ab51d0df63b658da8dbd7879a62ef1b70b35d Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Tue, 23 Feb 2016 09:44:59 -0800 Subject: [PATCH] Catch OSError *and* socket.error in camera client --- uvcclient/camera.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/uvcclient/camera.py b/uvcclient/camera.py index fbf4cba..7938600 100644 --- a/uvcclient/camera.py +++ b/uvcclient/camera.py @@ -14,6 +14,7 @@ # along with this program. If not, see . import logging +import socket # Python3 compatibility try: @@ -49,7 +50,7 @@ def _safe_request(self, *args, **kwargs): conn = httplib.HTTPConnection(self._host, self._port) conn.request(*args, **kwargs) return conn.getresponse() - except OSError: + except (socket.error, OSError): raise CameraConnectError('Unable to contact camera') except httplib.HTTPException as ex: raise CameraConnectError('Error connecting to camera: %s' % (