mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Issue #24683: Fixed crashes in _json functions called with arguments of
inappropriate type.
This commit is contained in:
parent
5a294d822b
commit
83236f7a8b
3 changed files with 19 additions and 2 deletions
|
@ -39,6 +39,12 @@ class TestSeparators:
|
|||
self.assertEqual(h2, h)
|
||||
self.assertEqual(d2, expect)
|
||||
|
||||
def test_illegal_separators(self):
|
||||
h = {1: 2, 3: 4}
|
||||
self.assertRaises(TypeError, self.dumps, h, separators=(b', ', ': '))
|
||||
self.assertRaises(TypeError, self.dumps, h, separators=(', ', b': '))
|
||||
self.assertRaises(TypeError, self.dumps, h, separators=(b', ', b': '))
|
||||
|
||||
|
||||
class TestPySeparators(TestSeparators, PyTest): pass
|
||||
class TestCSeparators(TestSeparators, CTest): pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue