Skip to content

Commit

Permalink
Improve the options handling in the streaming.Stream class, so that f…
Browse files Browse the repository at this point in the history
…alse values can be used. (In particular I want to be able to pass timeout=None, but one might also reasonably want to pass zero for some of the other options.)
  • Loading branch information
robinhouston committed Mar 5, 2011
1 parent fcaff74 commit 2ff2c64
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tweepy/streaming.py
Expand Up @@ -71,11 +71,11 @@ def __init__(self, auth, listener, **options):
self.auth = auth
self.listener = listener
self.running = False
self.timeout = options.get("timeout") or 5.0
self.timeout = options.get("timeout", 5.0)
self.retry_count = options.get("retry_count")
self.retry_time = options.get("retry_time") or 10.0
self.snooze_time = options.get("snooze_time") or 5.0
self.buffer_size = options.get("buffer_size") or 1500
self.retry_time = options.get("retry_time", 10.0)
self.snooze_time = options.get("snooze_time", 5.0)
self.buffer_size = options.get("buffer_size", 1500)
if options.get("secure"):
self.scheme = "https"
else:
Expand All @@ -96,7 +96,7 @@ def _run(self):
conn = None
exception = None
while self.running:
if self.retry_count and error_counter > self.retry_count:
if self.retry_count is not None and error_counter > self.retry_count:
# quit if error count greater than retry count
break
try:
Expand Down

0 comments on commit 2ff2c64

Please sign in to comment.