cpython: 356ed025dbae (original) (raw)

Mercurial > cpython

changeset 94476:356ed025dbae 3.3

Issues #23363, #23364, #23365, #23366: Fixed itertools overflow tests. Used PyMem_New to check overflow. [#23363]

Serhiy Storchaka storchaka@gmail.com
date Tue, 03 Feb 2015 01:34:09 +0200
parents 5c730d30ffbc
children 98c720c3e061 ab2e79c6cf6b
files Lib/test/test_itertools.py Modules/itertoolsmodule.c
diffstat 2 files changed, 11 insertions(+), 27 deletions(-)[+] [-] Lib/test/test_itertools.py 12 Modules/itertoolsmodule.c 26

line wrap: on

line diff

--- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -260,7 +260,7 @@ class TestBasicOps(unittest.TestCase): @support.bigaddrspacetest def test_combinations_overflow(self):

# Test implementation detail: tuple re-use @@ -346,7 +346,7 @@ class TestBasicOps(unittest.TestCase): @support.bigaddrspacetest def test_combinations_with_replacement_overflow(self):

# Test implementation detail: tuple re-use @@ -420,10 +420,8 @@ class TestBasicOps(unittest.TestCase): @support.bigaddrspacetest def test_permutations_overflow(self):

@support.impl_detail("tuple resuse is CPython specific") def test_permutations_tuple_reuse(self): @@ -939,8 +937,8 @@ class TestBasicOps(unittest.TestCase): @support.bigaddrspacetest def test_product_overflow(self):

@support.impl_detail("tuple reuse is specific to CPython") def test_product_tuple_reuse(self):

--- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -2003,15 +2003,14 @@ product_new(PyTypeObject *type, PyObject nargs = 0; } else { nargs = PyTuple_GET_SIZE(args);

@@ -2335,11 +2334,7 @@ combinations_new(PyTypeObject *type, PyO goto error; }

@@ -2668,11 +2663,7 @@ cwr_new(PyTypeObject *type, PyObject *ar goto error; }

@@ -3001,13 +2992,8 @@ permutations_new(PyTypeObject *type, PyO goto error; }