diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-10-01 20:33:48 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-10-01 20:33:48 +0000 |
commit | 9c73512e68fd9b50f19d129e120362b286bdb099 (patch) | |
tree | 7245e670d2e879b96dd4daa6220d7a3f61cde6a6 /gps.py | |
parent | 22d35e1cd302b8835e297365942ad01a703ca948 (diff) | |
download | gpsd-9c73512e68fd9b50f19d129e120362b286bdb099.tar.gz |
This patch fixes the end-of-test flakiness in the regression tests...
...but at the cost of relying on some Python internals that could break
in the future. The dependency is documented.
Some regression tests had to be rebuilt, as the checkfiles were missing
trailing lines due to this bug.
Diffstat (limited to 'gps.py')
-rwxr-xr-x | gps.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -430,6 +430,15 @@ class gps(gpsdata): def waiting(self): "Return True if data is ready for the client." + # WARNING! When we're testing here is whether there's data left in + # sockfile.readline()'s read buffer before we look to see if + # there's input waiting at the socket level. The Python sockfile API + # doesn't expose a way to do this, so we have to rely on knowing + # that the read buffer is the _rbuf member and that it's a StringIO + # object. Ugh. This could break. But without it, we go back ro + # having flaky regression errors at the end of check files. + if len(self.sockfile._rbuf.getvalue()) > 0: + return True (winput, woutput, wexceptions) = select.select((self.sock,), (), (), 0) return winput != [] |