diff options
Diffstat (limited to 'Lib/asyncio')
-rw-r--r-- | Lib/asyncio/streams.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py index 6b5e96a..9097e38 100644 --- a/Lib/asyncio/streams.py +++ b/Lib/asyncio/streams.py @@ -494,6 +494,9 @@ class StreamReader: @coroutine def readexactly(self, n): + if n < 0: + raise ValueError('readexactly size can not be less than zero') + if self._exception is not None: raise self._exception |