Author: Armin Rigo <[email protected]>
Branch: py3.5
Changeset: r88906:f140ab6e4d2e
Date: 2016-12-06 15:48 +0100
http://bitbucket.org/pypy/pypy/changeset/f140ab6e4d2e/

Log:    fixes for test_coroutines

diff --git a/lib-python/3/test/test_coroutines.py 
b/lib-python/3/test/test_coroutines.py
--- a/lib-python/3/test/test_coroutines.py
+++ b/lib-python/3/test/test_coroutines.py
@@ -747,9 +747,12 @@
 
     def test_corotype_1(self):
         ct = types.CoroutineType
-        self.assertIn('into coroutine', ct.send.__doc__)
-        self.assertIn('inside coroutine', ct.close.__doc__)
-        self.assertIn('in coroutine', ct.throw.__doc__)
+        self.assert_('into coroutine' in ct.send.__doc__ or
+                     'into generator/coroutine' in ct.send.__doc__)
+        self.assert_('inside coroutine' in ct.close.__doc__ or
+                     'inside generator/coroutine' in ct.close.__doc__)
+        self.assert_('in coroutine' in ct.throw.__doc__ or
+                     'in generator/coroutine' in ct.throw.__doc__)
         self.assertIn('of the coroutine', ct.__dict__['__name__'].__doc__)
         self.assertIn('of the coroutine', ct.__dict__['__qualname__'].__doc__)
         self.assertEqual(ct.__name__, 'coroutine')
diff --git a/pypy/interpreter/pyframe.py b/pypy/interpreter/pyframe.py
--- a/pypy/interpreter/pyframe.py
+++ b/pypy/interpreter/pyframe.py
@@ -298,7 +298,7 @@
                 raise oefmt(space.w_RuntimeError,
                             "coroutine wrapper %R attempted "
                             "to recursively wrap %R",
-                            w_wrapper, w_gen)
+                            w_wrapper, self)
             ec.in_coroutine_wrapper = True
             try:
                 w_gen = space.call_function(w_wrapper, w_gen)
diff --git a/pypy/interpreter/typedef.py b/pypy/interpreter/typedef.py
--- a/pypy/interpreter/typedef.py
+++ b/pypy/interpreter/typedef.py
@@ -825,9 +825,11 @@
     cr_code    = interp_attrproperty_w('pycode', cls=Coroutine),
     cr_await   = interp_attrproperty_w('w_yielded_from', cls=Coroutine),
     __name__   = GetSetProperty(Coroutine.descr__name__,
-                                Coroutine.descr_set__name__),
+                                Coroutine.descr_set__name__,
+                                doc="name of the coroutine"),
     __qualname__ = GetSetProperty(Coroutine.descr__qualname__,
-                                  Coroutine.descr_set__qualname__),
+                                  Coroutine.descr_set__qualname__,
+                                  doc="qualified name of the coroutine"),
     __weakref__ = make_weakref_descr(Coroutine),
 )
 assert not Coroutine.typedef.acceptable_as_base_class  # no __new__
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to