Author: Radu Ciorba <r...@devrandom.ro>
Branch: py3.6
Changeset: r94930:aac246060deb
Date: 2018-07-29 16:27 +0300
http://bitbucket.org/pypy/pypy/changeset/aac246060deb/

Log:    fix async generator bug when yielding a StopIteration

diff --git a/pypy/interpreter/generator.py b/pypy/interpreter/generator.py
--- a/pypy/interpreter/generator.py
+++ b/pypy/interpreter/generator.py
@@ -199,7 +199,6 @@
         except OperationError as e:
             if not e.match(space, space.w_StopIteration):
                 raise
-            e.normalize_exception(space)
             frame._report_stopiteration_sometimes(w_yf, e)
             try:
                 w_stop_value = space.getattr(e.get_w_value(space),
@@ -679,11 +678,8 @@
 
     def unwrap_value(self, w_value):
         if isinstance(w_value, AsyncGenValueWrapper):
-            w_value = w_value.w_value
-            if self.space.isinstance_w(w_value, self.space.w_tuple):
-                # Construct the exception manually, to avoid tuple unpacking.
-                w_value = self.space.call_function(self.space.w_StopIteration,
-                                                   w_value)
+            w_value = self.space.call_function(self.space.w_StopIteration,
+                                               w_value.w_value)
             raise OperationError(self.space.w_StopIteration, w_value)
         else:
             return w_value
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to