[pypy-commit] pypy py3.5-async: Only call __await__ if it exists

raffael_t pypy.commits at gmail.com
Fri Jul 29 16:05:51 EDT 2016


Author: Raffael Tfirst <raffael.tfirst at gmail.com>
Branch: py3.5-async
Changeset: r85918:5a3b4f095c70
Date: 2016-07-29 22:05 +0200
http://bitbucket.org/pypy/pypy/changeset/5a3b4f095c70/

Log:	Only call __await__ if it exists

diff --git a/pypy/interpreter/generator.py b/pypy/interpreter/generator.py
--- a/pypy/interpreter/generator.py
+++ b/pypy/interpreter/generator.py
@@ -309,7 +309,8 @@
         if w_iterable.pycode.co_flags & consts.CO_ITERABLE_COROUTINE:
             return self
         #look at typeobject.c, change to self.space.lookup(w_manager, "__await__")
-        res = self.descr__await__(space)
+        space.lookup(self, "__await__")
+        res = space.get_and_call_function(w_enter, None)
         return self
 
 


More information about the pypy-commit mailing list