Added explanation to exception handling
authorAaron Hill <aa1ronham@gmail.com>
Sat, 22 Feb 2014 04:11:57 +0000 (23:11 -0500)
committerAaron Hill <aa1ronham@gmail.com>
Sun, 27 Apr 2014 02:03:11 +0000 (22:03 -0400)
tweepy/streaming.py

index 8deccc4c1d26e7d49e5db2a96397a8fa9ddce2e2..dc93d585d282adf8141814bf3a5c15c77a754102 100644 (file)
@@ -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: