Replace Event.wait(0) with Event.is_set()

The functionality is identical, and IMHO the latter is much more readable
This commit is contained in:
Andrew Scheller
2016-05-10 15:03:28 +01:00
parent c44a4bfe4b
commit 87d00f9047
4 changed files with 13 additions and 13 deletions

View File

@@ -162,7 +162,7 @@ class SmoothedInputDevice(EventsMixin, InputDevice):
except DeviceClosed:
return super(SmoothedInputDevice, self).__repr__()
else:
if self.partial or self._queue.full.wait(0):
if self.partial or self._queue.full.is_set():
return super(SmoothedInputDevice, self).__repr__()
else:
return "<gpiozero.%s object on pin=%r, pull_up=%s>" % (