From 9753c0f5773822a862bd8e8ffef129090ee5e63a Mon Sep 17 00:00:00 2001 From: Aris Pikeas Date: Thu, 3 Apr 2014 16:43:45 -0700 Subject: [PATCH] Only call _data if stream.running=True Not sure why an extra delimiter int is spit out when you disconnect, but this should be enough of a bandaid. --- tweepy/streaming.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tweepy/streaming.py b/tweepy/streaming.py index be233ff..b37d0ed 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -223,7 +223,8 @@ class Stream(object): # read the next twitter status object if delimited_string.strip().isdigit(): next_status_obj = resp.read( int(delimited_string) ) - self._data(next_status_obj) + if self.running: + self._data(next_status_obj) if resp.isclosed(): self.on_closed(resp) -- 2.25.1