mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Raise more correct exception on overflow in setting buffer_size attribute of
expat parser.
This commit is contained in:
parent
931331a328
commit
de5f9f4f70
2 changed files with 10 additions and 6 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
from io import BytesIO
|
||||
import os
|
||||
import sys
|
||||
import sysconfig
|
||||
import unittest
|
||||
import traceback
|
||||
|
@ -543,6 +544,8 @@ class ChardataBufferTest(unittest.TestCase):
|
|||
parser.buffer_size = -1
|
||||
with self.assertRaises(ValueError):
|
||||
parser.buffer_size = 0
|
||||
with self.assertRaises((ValueError, OverflowError)):
|
||||
parser.buffer_size = sys.maxsize + 1
|
||||
with self.assertRaises(TypeError):
|
||||
parser.buffer_size = 512.0
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue