mirror of
https://github.com/python/cpython.git
synced 2025-08-28 12:45:07 +00:00
If size is specified, try to read at least size characters.
This is a alternative version of patch #1379332.
This commit is contained in:
parent
f8d767198f
commit
ca199432c2
2 changed files with 13 additions and 6 deletions
|
@ -274,7 +274,10 @@ class StreamReader(Codec):
|
|||
while True:
|
||||
# can the request can be satisfied from the character buffer?
|
||||
if chars < 0:
|
||||
if self.charbuffer:
|
||||
if size < 0:
|
||||
if self.charbuffer:
|
||||
break
|
||||
elif len(self.charbuffer) >= size:
|
||||
break
|
||||
else:
|
||||
if len(self.charbuffer) >= chars:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue