8000 asyncio.Task: rename internal nested variable to don't hide another d… · python/cpython@a5ba445 · GitHub
[go: up one dir, main page]

Skip to content

Commit a5ba445

Browse files
authored
asyncio.Task: rename internal nested variable to don't hide another declaration from outer scope (GH-32181)
1 parent dc2d840 commit a5ba445

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Modules/_asynciomodule.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2707,22 +2707,22 @@ task_step_impl(TaskObj *task, PyObject *exc)
27072707
/* The error is StopIteration and that means that
27082708
the underlying coroutine has resolved */
27092709

2710-
PyObject *res;
2710+
PyObject *tmp;
27112711
if (task->task_must_cancel) {
27122712
// Task is cancelled right before coro stops.
27132713
task->task_must_cancel = 0;
2714-
res = future_cancel((FutureObj*)task, task->task_cancel_msg);
2714+
tmp = future_cancel((FutureObj*)task, task->task_cancel_msg);
27152715
}
27162716
else {
2717-
res = future_set_result((FutureObj*)task, result);
2717+
tmp = future_set_result((FutureObj*)task, result);
27182718
}
27192719

27202720
Py_DECREF(result);
27212721

2722-
if (res == NULL) {
2722+
if (tmp == NULL) {
27232723
return NULL;
27242724
}
2725-
Py_DECREF(res);
2725+
Py_DECREF(tmp);
27262726
Py_RETURN_NONE;
27272727
}
27282728

@@ -2786,7 +2786,7 @@ task_step_impl(TaskObj *task, PyObject *exc)
27862786
/* Check if `result` is FutureObj or TaskObj (and not a subclass) */
27872787
if (Future_CheckExact(result) || Task_CheckExact(result)) {
27882788
PyObject *wrapper;
2789-
PyObject *res;
2789+
PyObject *tmp;
27902790
FutureObj *fut = (FutureObj*)result;
27912791

27922792
/* Check if `result` future is attached to a different loop */
@@ -2805,13 +2805,13 @@ task_step_impl(TaskObj *task, PyObject *exc)
28052805
if (wrapper == NULL) {
28062806
goto fail;
28072807
}
2808-
res = future_add_done_callback(
2808+
tmp = future_add_done_callback(
28092809
(FutureObj*)result, wrapper, task->task_context);
28102810
Py_DECREF(wrapper);
2811-
if (res == NULL) {
2811+
if (tmp == NULL) {
28122812
goto fail;
28132813
}
2814-
Py_DECREF(res);
2814+
Py_DECREF(tmp);
28152815

28162816
/* task._fut_waiter = result */
28172817
task->task_fut_waiter = result; /* no incref is necessary */
@@ -2853,7 +2853,7 @@ task_step_impl(TaskObj *task, PyObject *exc)
28532853
if (o != NULL && o != Py_None) {
28542854
/* `result` is a Future-compatible object */
28552855
PyObject *wrapper;
2856-
PyObject *res;
2856+
PyObject *tmp;
28572857

28582858
int blocking = PyObject_IsTrue(o);
28592859
Py_DECREF(o);
@@ -2897,13 +2897,13 @@ task_step_impl(TaskObj *task, PyObject *exc)
28972897
PyObject *stack[2];
28982898
stack[0] = wrapper;
28992899
stack[1] = (PyObject *)task->task_context;
2900-
res = PyObject_Vectorcall(add_cb, stack, 1, context_kwname);
2900+
tmp = PyObject_Vectorcall(add_cb, stack, 1, context_kwname);
29012901
Py_DECREF(add_cb);
29022902
Py_DECREF(wrapper);
2903-
if (res == NULL) {
2903+
if (tmp == NULL) {
29042904
goto fail;
29052905
}
2906-
Py_DECREF(res);
2906+
Py_DECREF(tmp);
29072907

29082908
/* task._fut_waiter = result */
29092909
task->task_fut_waiter = result; /* no incref is necessary */

0 commit comments

Comments
 (0)
0