Skip to content

Commit e11cf73

Browse files
committed
Tweak exception message
1 parent ad09d80 commit e11cf73

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Lib/asyncio/tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ def _repr_info(self):
115115
return base_tasks._task_repr_info(self)
116116

117117
def set_result(self, result):
118-
raise RuntimeError('Tasks do not support set_result operation')
118+
raise RuntimeError('Task does not support set_result operation')
119119

120120
def set_exception(self, exception):
121-
raise RuntimeError('Tasks do not support set_exception operation')
121+
raise RuntimeError('Task does not support set_exception operation')
122122

123123
def get_stack(self, *, limit=None):
124124
"""Return the list of stack frames for this task's coroutine.

Modules/_asynciomodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,7 +2244,7 @@ _asyncio_Task_set_result(TaskObj *self, PyObject *result)
22442244
/*[clinic end generated code: output=1dcae308bfcba318 input=9d1a00c07be41bab]*/
22452245
{
22462246
PyErr_SetString(PyExc_RuntimeError,
2247-
"Tasks do not support set_result operation");
2247+
"Task does not support set_result operation");
22482248
return NULL;
22492249
}
22502250

@@ -2260,7 +2260,7 @@ _asyncio_Task_set_exception(TaskObj *self, PyObject *exception)
22602260
/*[clinic end generated code: output=bc377fc28067303d input=9a8f65c83dcf893a]*/
22612261
{
22622262
PyErr_SetString(PyExc_RuntimeError,
2263-
"Tasks do not support set_exception operation");
2263+
"Task doed not support set_exception operation");
22642264
return NULL;
22652265
}
22662266

0 commit comments

Comments
 (0)