summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-04-14 03:52:43 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-04-14 03:52:43 (GMT)
commita548a30fed74819c4b1411dde4f07944770b5df4 (patch)
treeacc7b4cb036775e3805e85883d593f0bf91dd028 /Lib
parent79f3ef63361b00e2e70a9d8edba6afa5096d3380 (diff)
parentf6e50b4a811477206d1c252a531c31029ea93866 (diff)
downloadcpython-a548a30fed74819c4b1411dde4f07944770b5df4.zip
cpython-a548a30fed74819c4b1411dde4f07944770b5df4.tar.gz
cpython-a548a30fed74819c4b1411dde4f07944770b5df4.tar.bz2
merge 3.4 (#21209)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_pep380.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/test/test_pep380.py b/Lib/test/test_pep380.py
index 4a43b7d..69194df 100644
--- a/Lib/test/test_pep380.py
+++ b/Lib/test/test_pep380.py
@@ -993,6 +993,25 @@ class TestPEP380Operation(unittest.TestCase):
del inner_gen
gc_collect()
+ def test_send_tuple_with_custom_generator(self):
+ # See issue #21209.
+ class MyGen:
+ def __iter__(self):
+ return self
+ def __next__(self):
+ return 42
+ def send(self, what):
+ nonlocal v
+ v = what
+ return None
+ def outer():
+ v = yield from MyGen()
+ g = outer()
+ next(g)
+ v = None
+ g.send((1, 2, 3, 4))
+ self.assertEqual(v, (1, 2, 3, 4))
+
def test_main():
from test import support