summaryrefslogtreecommitdiff
path: root/gps
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2016-04-08 10:07:46 -0700
committerEric S. Raymond <esr@thyrsus.com>2016-04-09 04:39:15 -0400
commitdb33488b20d15506eac5ad033b687cc90f8edd69 (patch)
treebe21f5040c5f8d21d7880e2a6e20fb59c15f4229 /gps
parente818ba3a132cc233fd24126802bbbdcafd0fa6d5 (diff)
downloadgpsd-db33488b20d15506eac5ad033b687cc90f8edd69.tar.gz
Fixes a client.py exception for Python 3.
In Python 3, exception objects are local to the try/except block, making them inaccessible outside that block. It was probably actually an error to set the "message" to be the exception object rather than its string representation, anyway. TESTED: Ran xgps without gpsd running, and verified that the proper error box is displayed, in both Python 2 and Python 3 (with appropriate builds of the extensions).
Diffstat (limited to 'gps')
-rw-r--r--gps/client.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/gps/client.py b/gps/client.py
index ec9d1008..cdc5059a 100644
--- a/gps/client.py
+++ b/gps/client.py
@@ -67,7 +67,8 @@ class gpscommon:
self.sock = socket.socket(af, socktype, proto)
# if self.debuglevel > 0: print 'connect:', (host, port)
self.sock.connect(sa)
- except socket.error as msg:
+ except socket.error as e:
+ msg = str(e)
# if self.debuglevel > 0: print 'connect fail:', (host, port)
self.close()
continue