summaryrefslogtreecommitdiff
path: root/gps
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2018-09-14 19:04:45 -0700
committerGary E. Miller <gem@rellim.com>2018-09-14 19:04:45 -0700
commit2af62c86f2ff598900141be516e06345408a12ab (patch)
treeb39d573785576c9f4b3237c7699f810b98800972 /gps
parenta8c1970a9c20b1afdfe178efd39433fae923de42 (diff)
downloadgpsd-2af62c86f2ff598900141be516e06345408a12ab.tar.gz
gps/client.py: remove ConnectionRefusedError which is Python 3 only.
We have to support Python 2 for a bit longer.
Diffstat (limited to 'gps')
-rw-r--r--gps/client.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/gps/client.py b/gps/client.py
index 27027bc7..4b3573ca 100644
--- a/gps/client.py
+++ b/gps/client.py
@@ -65,14 +65,8 @@ class gpscommon(object):
if self.verbose > 0:
print('connected to tcp://{}:{}'.format(host, port))
break
- except ConnectionRefusedError as cre:
- # Python 2.7 doc does have this exception
- # Python 3 says is is same as errno ECONNREFUSED
- if self.verbose > 1:
- msg = str(cre) + ' (to {}:{})'.format(host, port)
- sys.stderr.write("error: {}\n".format(msg.strip()))
- self.close()
- return # relatively routine error
+ # do not use except ConnectionRefusedError
+ # # Python 2.7 doc does have this exception
except socket.error as e:
if self.verbose > 1:
msg = str(e) + ' (to {}:{})'.format(host, port)