Serhiy Storchaka added the comment: Yet one special case -- if asynchronous iterator in aiter_wrapper is an instance of StopIteration.
Proposed patch adds the function _PyGen_SetStopIterationValue() that raises StopIteration with correctly wrapped value (exception is normalized only if needed) and replaces 4 code duplications with it. The patch also includes Yury's variant of Stefan's patch and additional tests. ---------- stage: test needed -> patch review Added file: http://bugs.python.org/file45353/gen_set_stopiteration_value.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23996> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com