diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-09-07 19:54:08 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-09-07 19:54:08 (GMT) |
commit | 6c8b66cd261c6418566700527784b17bb459db1f (patch) | |
tree | 3df00565bbfc1a2ca40ae66cb6a357efc6e9c922 /Lib/test/test_pyexpat.py | |
parent | 3b1bc7828dff9c58031f60f9d603ca78cbba96ea (diff) | |
parent | de5f9f4f70c6527c49d482e3b0bb0aad2851d34c (diff) | |
download | cpython-6c8b66cd261c6418566700527784b17bb459db1f.zip cpython-6c8b66cd261c6418566700527784b17bb459db1f.tar.gz cpython-6c8b66cd261c6418566700527784b17bb459db1f.tar.bz2 |
Raise more correct exception on overflow in setting buffer_size attribute of
expat parser.
Diffstat (limited to 'Lib/test/test_pyexpat.py')
-rw-r--r-- | Lib/test/test_pyexpat.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py index ad05b52..550aebf 100644 --- a/Lib/test/test_pyexpat.py +++ b/Lib/test/test_pyexpat.py @@ -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 |