From: Aris Pikeas Date: Thu, 3 Apr 2014 23:43:45 +0000 (-0700) Subject: Only call _data if stream.running=True X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9753c0f5773822a862bd8e8ffef129090ee5e63a;p=tweepy.git 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. --- 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)