diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2014-03-04 23:22:15 (GMT) |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2014-03-04 23:22:15 (GMT) |
commit | 25ea45db81540b8c589c65edf2564c04461b1f34 (patch) | |
tree | e749a6c7ccc7ecafe5add84477796f87dffa9589 /Lib/test/test_range.py | |
parent | d74ac82df9cda264c120379a41e7add5d64b9d01 (diff) | |
parent | 4ca688edeb07de955e1ef67c11f0e327f12ffa6e (diff) | |
download | cpython-25ea45db81540b8c589c65edf2564c04461b1f34.zip cpython-25ea45db81540b8c589c65edf2564c04461b1f34.tar.gz cpython-25ea45db81540b8c589c65edf2564c04461b1f34.tar.bz2 |
Merge with 3.3
Diffstat (limited to 'Lib/test/test_range.py')
-rw-r--r-- | Lib/test/test_range.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_range.py b/Lib/test/test_range.py index d9d4cf8..64b6a77 100644 --- a/Lib/test/test_range.py +++ b/Lib/test/test_range.py @@ -380,6 +380,18 @@ class RangeTest(unittest.TestCase): it = pickle.loads(d) self.assertEqual(list(it), data[1:]) + def test_exhausted_iterator_pickling(self): + r = range(20) + i = iter(r) + while True: + r = next(i) + if r == 19: + break + d = pickle.dumps(i) + i2 = pickle.loads(d) + self.assertEqual(list(i), []) + self.assertEqual(list(i2), []) + def test_odd_bug(self): # This used to raise a "SystemError: NULL result without error" # because the range validation step was eating the exception |