summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorOren Milman <orenmn@gmail.com>2017-08-26 12:27:50 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-08-26 12:27:50 (GMT)
commit8e67981fc8e1bf3cb9774b5fbf4a39b8d65ba4ff (patch)
treec8067ed049bd6987f5d5dd1183fff869f2dd8eaf /Lib/test
parentcb7fdf69ec9235cb358580f189089eaf575fb9df (diff)
downloadcpython-8e67981fc8e1bf3cb9774b5fbf4a39b8d65ba4ff.zip
cpython-8e67981fc8e1bf3cb9774b5fbf4a39b8d65ba4ff.tar.gz
cpython-8e67981fc8e1bf3cb9774b5fbf4a39b8d65ba4ff.tar.bz2
[3.6] bpo-28261: Prevent raising SystemError where PyArg_ParseTuple is used to parse non-args. (#3210)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_audioop.py4
-rw-r--r--Lib/test/test_io.py1
2 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_audioop.py b/Lib/test/test_audioop.py
index 8f34d72..9baa62a 100644
--- a/Lib/test/test_audioop.py
+++ b/Lib/test/test_audioop.py
@@ -405,6 +405,10 @@ class TestAudioop(unittest.TestCase):
self.assertEqual(audioop.ratecv(datas[w], w, 1, 8000, 8000, None, 30, 10)[0],
expected[w])
+ self.assertRaises(TypeError, audioop.ratecv, b'', 1, 1, 8000, 8000, 42)
+ self.assertRaises(TypeError, audioop.ratecv,
+ b'', 1, 1, 8000, 8000, (1, (42,)))
+
def test_reverse(self):
for w in 1, 2, 3, 4:
self.assertEqual(audioop.reverse(b'', w), b'')
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 8c91ad2..6a2c7a9f 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -3410,6 +3410,7 @@ class IncrementalNewlineDecoderTest(unittest.TestCase):
decoder = codecs.getincrementaldecoder("utf-8")()
decoder = self.IncrementalNewlineDecoder(decoder, translate=True)
self.check_newline_decoding_utf8(decoder)
+ self.assertRaises(TypeError, decoder.setstate, 42)
def test_newline_bytes(self):
# Issue 5433: Excessive optimization in IncrementalNewlineDecoder