diff options
Diffstat (limited to 'Lib/asynchat.py')
-rw-r--r-- | Lib/asynchat.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/asynchat.py b/Lib/asynchat.py index 91f0bb2fd9..fc6cabe7f2 100644 --- a/Lib/asynchat.py +++ b/Lib/asynchat.py @@ -99,6 +99,8 @@ class async_chat(asyncore.dispatcher): """ if isinstance(term, str) and self.use_encoding: term = bytes(term, self.encoding) + elif isinstance(term, int) and term < 0: + raise ValueError('the number of received bytes must be positive') self.terminator = term def get_terminator(self): |