summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-09-07 22:51:56 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2015-09-07 22:51:56 +0300
commitde5f9f4f70c6527c49d482e3b0bb0aad2851d34c (patch)
treec93349effc14d46a0b617dd59c01c32337dd29f6 /Lib/test
parent931331a328d522bb014f9e9c13884d7566108268 (diff)
downloadcpython-git-de5f9f4f70c6527c49d482e3b0bb0aad2851d34c.tar.gz
Raise more correct exception on overflow in setting buffer_size attribute of
expat parser.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_pyexpat.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py
index 7548924e0f..216a46b903 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