diff options
Diffstat (limited to 'gpspoller.py')
| -rw-r--r-- | gpspoller.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gpspoller.py b/gpspoller.py index 13ad5bb..37cd441 100644 --- a/gpspoller.py +++ b/gpspoller.py @@ -16,6 +16,7 @@ class GpsPoller(threading.Thread): changed = False
fix=0
satellites=0
+ gps =""
def __init__(self,port,test=False):
self.test=test
@@ -88,8 +89,9 @@ class GpsPoller(threading.Thread): except StopIteration:
pass
- def __del__():
- self.gps.close()
+ def __del__(self):
+ if self.gps!="":
+ self.gps.close()
if __name__ == '__main__':
|
