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
c1eddf1a
Unverified
Commit
c1eddf1a
authored
Nov 05, 2016
by
Aaron Hill
Browse files
Don't return None from ReadBuffer.read_line and ReadBuffer.read_len
Closes #698
parent
22bfa552
Changes
1
Hide whitespace changes
Inline
Side-by-side
tweepy/streaming.py
View file @
c1eddf1a
...
...
@@ -162,6 +162,7 @@ class ReadBuffer(object):
return
self
.
_pop
(
length
)
read_len
=
max
(
self
.
_chunk_size
,
length
-
len
(
self
.
_buffer
))
self
.
_buffer
+=
self
.
_stream
.
read
(
read_len
)
return
six
.
b
(
''
)
def
read_line
(
self
,
sep
=
six
.
b
(
'
\n
'
)):
"""Read the data stream until a given separator is found (default
\n
)
...
...
@@ -178,6 +179,7 @@ class ReadBuffer(object):
else
:
start
=
len
(
self
.
_buffer
)
self
.
_buffer
+=
self
.
_stream
.
read
(
self
.
_chunk_size
)
return
six
.
b
(
''
)
def
_pop
(
self
,
length
):
r
=
self
.
_buffer
[:
length
]
...
...
@@ -323,7 +325,7 @@ class Stream(object):
raise
TweepError
(
'Expecting length, unexpected value found'
)
next_status_obj
=
buf
.
read_len
(
length
)
if
self
.
running
:
if
self
.
running
and
next_status_obj
:
self
.
_data
(
next_status_obj
)
# # Note: keep-alive newlines might be inserted before each length value.
...
...
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