diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-11-15 09:45:10 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-11-15 09:45:10 -0500 |
commit | aec99a6ce4b7070fe53073b076dbe4f59934d65f (patch) | |
tree | 8895183550b63c68c230fdf0b9cedfe62c92846a /gps | |
parent | c5780e1f8f201193021460acfd0bf1742ea1381c (diff) | |
download | gpsd-aec99a6ce4b7070fe53073b076dbe4f59934d65f.tar.gz |
Insert required calls to Python Eceptions base class.
All regression tests pass.
Diffstat (limited to 'gps')
-rw-r--r-- | gps/client.py | 5 | ||||
-rw-r--r-- | gps/fake.py | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gps/client.py b/gps/client.py index 6c18dd07..e02804e5 100644 --- a/gps/client.py +++ b/gps/client.py @@ -1,7 +1,7 @@ # This file is Copyright (c) 2010 by the GPSD project # BSD terms apply: see the file COPYING in the distribution root for details. # -import time, socket, sys, select +import time, socket, sys, select, exceptions if sys.hexversion >= 0x2060000: import json # For Python 2.6 @@ -10,8 +10,9 @@ else: GPSD_PORT="2947" -class json_error: +class json_error(exceptions.Exception): def __init__(self, data, explanation): + exceptions.Exception.__init__(self) self.data = data self.explanation = explanation diff --git a/gps/fake.py b/gps/fake.py index ff6316f3..f6684686 100644 --- a/gps/fake.py +++ b/gps/fake.py @@ -124,6 +124,7 @@ else: class TestLoadError(exceptions.Exception): def __init__(self, msg): + exceptions.Exception.__init__(self) self.msg = msg class TestLoad: @@ -212,6 +213,7 @@ class TestLoad: class PacketError(exceptions.Exception): def __init__(self, msg): + exceptions.Exception.__init__(self) self.msg = msg class FakeGPS: @@ -388,6 +390,7 @@ class FakeUDP(FakeGPS): class DaemonError(exceptions.Exception): def __init__(self, msg): + exceptions.Exception.__init__(self) self.msg = msg def __str__(self): return repr(self.msg) @@ -501,6 +504,7 @@ class DaemonInstance: class TestSessionError(exceptions.Exception): def __init__(self, msg): + exceptions.Exception.__init__(self) self.msg = msg class TestSession: |