mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
(Merge 3.4) Issue #11259: asynchat.async_chat().set_terminator() now raises a
ValueError if the number of received bytes is negative.
This commit is contained in:
commit
db5f8fcde6
3 changed files with 13 additions and 0 deletions
|
@ -311,5 +311,13 @@ class TestFifo(unittest.TestCase):
|
|||
self.assertEqual(f.pop(), (0, None))
|
||||
|
||||
|
||||
class TestNotConnected(unittest.TestCase):
|
||||
def test_disallow_negative_terminator(self):
|
||||
# Issue #11259
|
||||
client = asynchat.async_chat()
|
||||
self.assertRaises(ValueError, client.set_terminator, -1)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue