Unverified Kaydet (Commit) 49418f6d authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka Kaydeden (comit) GitHub

[3.6] bpo-33584: Fix several minor bugs in asyncio. (GH-7003) (#7006)

* repr() was called for a borrowed link.
* str() was used instead of repr() in formatting one error message.
(cherry picked from commit 6655354a)
üst 10a122c0
...@@ -233,7 +233,7 @@ class Task(futures.Future): ...@@ -233,7 +233,7 @@ class Task(futures.Future):
self._step, self._step,
RuntimeError( RuntimeError(
'yield was used instead of yield from for ' 'yield was used instead of yield from for '
'generator in task {!r} with {}'.format( 'generator in task {!r} with {!r}'.format(
self, result))) self, result)))
else: else:
# Yielding something else is an error. # Yielding something else is an error.
......
...@@ -2248,19 +2248,19 @@ set_exception: ...@@ -2248,19 +2248,19 @@ set_exception:
} }
if (res == 1) { if (res == 1) {
/* `result` is a generator */ /* `result` is a generator */
PyObject *ret; o = task_set_error_soon(
ret = task_set_error_soon(
task, PyExc_RuntimeError, task, PyExc_RuntimeError,
"yield was used instead of yield from for " "yield was used instead of yield from for "
"generator in task %R with %S", task, result); "generator in task %R with %R", task, result);
Py_DECREF(result); Py_DECREF(result);
return ret; return o;
} }
/* The `result` is none of the above */ /* The `result` is none of the above */
Py_DECREF(result); o = task_set_error_soon(
return task_set_error_soon(
task, PyExc_RuntimeError, "Task got bad yield: %R", result); task, PyExc_RuntimeError, "Task got bad yield: %R", result);
Py_DECREF(result);
return o;
self_await: self_await:
o = task_set_error_soon( o = task_set_error_soon(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment