From: Aaron Hill Date: Sat, 21 Dec 2013 01:56:24 +0000 (-0500) Subject: Merge branch 'backoff' of https://github.com/tewalds/tweepy into tewalds-backoff X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a592ff55540b20e99229355e54291eba86c79266;p=tweepy.git Merge branch 'backoff' of https://github.com/tewalds/tweepy into tewalds-backoff Conflicts: test_requirements.txt tweepy/streaming.py --- a592ff55540b20e99229355e54291eba86c79266 diff --cc test_requirements.txt index fccb1f2,bad5cc6..e52ad2a --- a/test_requirements.txt +++ b/test_requirements.txt @@@ -1,3 -1,3 +1,4 @@@ httreplay==0.1.4 coveralls==0.2 +unittest2==0.5.1 + mock==1.0.1 diff --cc tests/test_streaming.py index d480605,07f02af..fdeb2c9 --- a/tests/test_streaming.py +++ b/tests/test_streaming.py @@@ -1,7 -1,8 +1,8 @@@ from time import sleep -import unittest +import unittest2 as unittest from tweepy.api import API + from tweepy.auth import OAuthHandler from tweepy.models import Status from tweepy.streaming import Stream, StreamListener diff --cc tweepy/streaming.py index e9d47e4,67abd60..cd6bffb --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@@ -164,15 -147,10 +168,15 @@@ class Stream(object) else: error_counter = 0 self.retry_time = self.retry_time_start - self.snooze_time = self.snooze_time_start + self.snooze_time = self.snooze_time_step self.listener.on_connect() self._read_loop(resp) - except timeout: + except (timeout, ssl.SSLError), exc: + # If it's not time out treat it like any other exception + if isinstance(exc, ssl.SSLError) and not (exc.args and 'timed out' in str(exc.args[0])): + exception = exc + break + if self.listener.on_timeout() == False: break if self.running is False: