summaryrefslogtreecommitdiff
path: root/Lib/asyncio/base_tasks.py
diff options
context:
space:
mode:
authorItamar Ostricher <itamarost@gmail.com>2023-05-01 14:10:13 -0700
committerGitHub <noreply@github.com>2023-05-01 15:10:13 -0600
commita474e04388c2ef6aca75c26cb70a1b6200235feb (patch)
tree43520d5ad16016620f149dc1e84d4d57e45051d5 /Lib/asyncio/base_tasks.py
parent59bc36aacddd5a3acd32c80c0dfd0726135a7817 (diff)
downloadcpython-git-a474e04388c2ef6aca75c26cb70a1b6200235feb.tar.gz
gh-97696: asyncio eager tasks factory (#102853)
Co-authored-by: Jacob Bower <jbower@meta.com> Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Diffstat (limited to 'Lib/asyncio/base_tasks.py')
-rw-r--r--Lib/asyncio/base_tasks.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/asyncio/base_tasks.py b/Lib/asyncio/base_tasks.py
index 26298e638c..c907b68341 100644
--- a/Lib/asyncio/base_tasks.py
+++ b/Lib/asyncio/base_tasks.py
@@ -15,11 +15,13 @@ def _task_repr_info(task):
info.insert(1, 'name=%r' % task.get_name())
- coro = coroutines._format_coroutine(task._coro)
- info.insert(2, f'coro=<{coro}>')
-
if task._fut_waiter is not None:
- info.insert(3, f'wait_for={task._fut_waiter!r}')
+ info.insert(2, f'wait_for={task._fut_waiter!r}')
+
+ if task._coro:
+ coro = coroutines._format_coroutine(task._coro)
+ info.insert(2, f'coro=<{coro}>')
+
return info