From 6adf9c7d8f4deb7bc0a21348ea65f29a95c7de1a Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Fri, 21 Feb 2014 23:11:57 -0500 Subject: [PATCH] Added explanation to exception handling --- tweepy/streaming.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 8deccc4..dc93d58 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -167,12 +167,12 @@ class Stream(object): self.snooze_time = self.snooze_time_step self.listener.on_connect() self._read_loop(resp) - except (timeout, ssl.SSLError) as exc: + except (Timeout, ssl.SSLError) as exc: + # This is still necessary, as a SSLError can actually be thrown when using Requests # 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: -- 2.25.1