Commit 9753c0f5 authored by Aris Pikeas's avatar Aris Pikeas
Browse files

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.
parent 5bdd86a4
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment