Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Unified Diff: Modules/_asynciomodule.c

Issue 29271: Task.current_task(None) returns unexpected result
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_asyncio/test_tasks.py ('k') | Modules/clinic/_asynciomodule.c.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Modules/_asynciomodule.c Fri Jan 13 19:18:33 2017 +0000
+++ b/Modules/_asynciomodule.c Fri Jan 13 17:17:17 2017 -0500
@@ -1414,7 +1414,7 @@
@classmethod
_asyncio.Task.current_task
- loop: 'O' = NULL
+ loop: 'O' = None
Return the currently running task in an event loop or None.
@@ -1425,11 +1425,11 @@
static PyObject *
_asyncio_Task_current_task_impl(PyTypeObject *type, PyObject *loop)
-/*[clinic end generated code: output=99fbe7332c516e03 input=cd784537f02cf833]*/
+/*[clinic end generated code: output=99fbe7332c516e03 input=a0d6cdf2e3b243e1]*/
{
PyObject *res;
- if (loop == NULL) {
+ if (loop == Py_None) {
loop = _PyObject_CallNoArg(asyncio_get_event_loop);
if (loop == NULL) {
return NULL;
@@ -1501,7 +1501,7 @@
@classmethod
_asyncio.Task.all_tasks
- loop: 'O' = NULL
+ loop: 'O' = None
Return a set of all tasks for an event loop.
@@ -1510,11 +1510,11 @@
static PyObject *
_asyncio_Task_all_tasks_impl(PyTypeObject *type, PyObject *loop)
-/*[clinic end generated code: output=11f9b20749ccca5d input=cd64aa5f88bd5c49]*/
+/*[clinic end generated code: output=11f9b20749ccca5d input=c6f5b53bd487488f]*/
{
PyObject *res;
- if (loop == NULL) {
+ if (loop == Py_None) {
loop = _PyObject_CallNoArg(asyncio_get_event_loop);
if (loop == NULL) {
return NULL;
« no previous file with comments | « Lib/test/test_asyncio/test_tasks.py ('k') | Modules/clinic/_asynciomodule.c.h » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+