Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
tweepy
Commits
c2edbea6
Commit
c2edbea6
authored
Feb 04, 2012
by
Dan Fairs
Browse files
Check that the response is not closed each time around the loop.
parent
a6d701d7
Changes
1
Show whitespace changes
Inline
Side-by-side
tweepy/streaming.py
View file @
c2edbea6
...
...
@@ -141,12 +141,8 @@ class Stream(object):
self
.
running
=
False
def
_read_loop
(
self
,
resp
):
while
self
.
running
:
if
resp
.
isclosed
():
break
buf
=
''
while
True
:
while
self
.
running
and
not
resp
.
isclosed
()
:
c
=
resp
.
read
(
self
.
buffer_size
)
idx
=
c
.
rfind
(
'
\n
'
)
if
idx
>
-
1
:
...
...
@@ -161,6 +157,7 @@ class Stream(object):
# buffer
buf
+=
c
def
_start
(
self
,
async
):
self
.
running
=
True
if
async
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment