Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-46994: Accept explicit contextvars.Context in asyncio create_task() API #31837

Merged
merged 9 commits into from
Mar 14, 2022
Prev Previous commit
Next Next commit
Fix typo
asvetlov committed Mar 13, 2022
commit 7a9bdede3486dde1141cec5751dd9f593ace588e
2 changes: 1 addition & 1 deletion Lib/asyncio/taskgroups.py
Original file line number Diff line number Diff line change
@@ -143,7 +143,7 @@ def create_task(self, coro, *, name=None, context=None):
raise RuntimeError(f"TaskGroup {self!r} has not been entered")
if self._exiting and self._unfinished_tasks == 0:
raise RuntimeError(f"TaskGroup {self!r} is finished")
if cotext is None:
if context is None:
task = self._loop.create_task(coro)
else:
task = self._loop.create_task(coro, context=context)