Skip to content

Commit

Permalink
Fix None comparison.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Aug 26, 2021
1 parent f6cfd51 commit 0c2ac47
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/paho/mqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,10 @@ def wait_for_publish(self, timeout=None):
elif self.rc > 0:
raise RuntimeError('Message publish failed: %s' % (error_string(self.rc)))

timeout_time = None if not timeout else time.time() + timeout
timeout_tenth = None if not timeout else timeout / 10.
timeout_time = None if timeout is None else time.time() + timeout
timeout_tenth = None if timeout is None else timeout / 10.
def timed_out():
return False if not timeout else time.time() > timeout_time
return False if timeout is None else time.time() > timeout_time

with self._condition:
while not self._published and not timed_out():
Expand Down

0 comments on commit 0c2ac47

Please sign in to comment.