Author: Raffael Tfirst <raffael.tfi...@gmail.com>
Branch: py3.5-async
Changeset: r85953:8a281ce6dd54
Date: 2016-07-31 22:53 +0200
http://bitbucket.org/pypy/pypy/changeset/8a281ce6dd54/

Log:    Pass object to function returned by lookup instead of None

diff --git a/pypy/interpreter/generator.py b/pypy/interpreter/generator.py
--- a/pypy/interpreter/generator.py
+++ b/pypy/interpreter/generator.py
@@ -313,7 +313,7 @@
             raise oefmt(space.w_AttributeError,
                         "object %T does not have __await__ method",
                         self)
-        res = space.get_and_call_function(w_await, None)
+        res = space.get_and_call_function(w_await, self)
         if res is not None:
             if (isinstance(res, Coroutine) or
                 res.pycode.co_flags & consts.CO_ITERABLE_COROUTINE):
diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -1472,7 +1472,7 @@
             raise oefmt(space.w_AttributeError,
                         "object %T does not have __aiter__ method",
                         w_obj)
-        w_iter = space.get_and_call_function(w_func, None)
+        w_iter = space.get_and_call_function(w_func, w_obj)
         w_awaitable = w_iter._GetAwaitableIter(self.space)
         if w_awaitable is None:
             raise oefmt(space.w_TypeError,
@@ -1487,7 +1487,7 @@
             raise oefmt(space.w_AttributeError,
                         "object %T does not have __anext__ method",
                         w_aiter)
-        w_next_iter = space.get_and_call_function(w_func, None)
+        w_next_iter = space.get_and_call_function(w_func, w_aiter)
         w_awaitable = w_next_iter._GetAwaitableIter(self.space)
         if w_awaitable is None:
             raise oefmt(space.w_TypeError,
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to