mirror of
https://github.com/python/cpython.git
synced 2025-09-30 04:15:43 +00:00
This commit is contained in:
parent
aac875fa2f
commit
fa448de97d
3 changed files with 18 additions and 2 deletions
|
@ -1103,6 +1103,21 @@ class CoroutineTest(unittest.TestCase):
|
||||||
"coroutine is being awaited already"):
|
"coroutine is being awaited already"):
|
||||||
waiter(coro).send(None)
|
waiter(coro).send(None)
|
||||||
|
|
||||||
|
def test_await_16(self):
|
||||||
|
# See https://bugs.python.org/issue29600 for details.
|
||||||
|
|
||||||
|
async def f():
|
||||||
|
return ValueError()
|
||||||
|
|
||||||
|
async def g():
|
||||||
|
try:
|
||||||
|
raise KeyError
|
||||||
|
except:
|
||||||
|
return await f()
|
||||||
|
|
||||||
|
_, result = run_async(g())
|
||||||
|
self.assertIsNone(result.__context__)
|
||||||
|
|
||||||
def test_with_1(self):
|
def test_with_1(self):
|
||||||
class Manager:
|
class Manager:
|
||||||
def __init__(self, name):
|
def __init__(self, name):
|
||||||
|
|
|
@ -10,6 +10,8 @@ What's New in Python 3.6.1 final?
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- bpo-29600: Fix wrapping coroutine return values in StopIteration.
|
||||||
|
|
||||||
- bpo-29723: The ``sys.path[0]`` initialization change for bpo-29139 caused a
|
- bpo-29723: The ``sys.path[0]`` initialization change for bpo-29139 caused a
|
||||||
regression by revealing an inconsistency in how sys.path is initialized when
|
regression by revealing an inconsistency in how sys.path is initialized when
|
||||||
executing ``__main__`` from a zipfile, directory, or other import location.
|
executing ``__main__`` from a zipfile, directory, or other import location.
|
||||||
|
|
|
@ -575,8 +575,7 @@ _PyGen_SetStopIterationValue(PyObject *value)
|
||||||
PyObject *e;
|
PyObject *e;
|
||||||
|
|
||||||
if (value == NULL ||
|
if (value == NULL ||
|
||||||
(!PyTuple_Check(value) &&
|
(!PyTuple_Check(value) && !PyExceptionInstance_Check(value)))
|
||||||
!PyObject_TypeCheck(value, (PyTypeObject *) PyExc_StopIteration)))
|
|
||||||
{
|
{
|
||||||
/* Delay exception instantiation if we can */
|
/* Delay exception instantiation if we can */
|
||||||
PyErr_SetObject(PyExc_StopIteration, value);
|
PyErr_SetObject(PyExc_StopIteration, value);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue