From 92fd341d1205aed87dfea2bfbdd3c4f738dbb3f1 Mon Sep 17 00:00:00 2001 From: Josh Roesslein Date: Sat, 8 Aug 2009 02:08:26 -0500 Subject: [PATCH] Catch fatal errors and kill stream loop. --- tweepy/streaming.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tweepy/streaming.py b/tweepy/streaming.py index fd2b111..2b9491f 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -47,6 +47,10 @@ class Stream(object): except timeout: conn.close() continue + except Exception: + # any other exception is fatal, so kill loop + self.running = False + break # cleanup conn.close() -- 2.25.1