Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add missing context kwargs to _sentry_task_factory
  • Loading branch information
JohnnyDeuss committed Jul 21, 2023
commit e87512c6f0ea0febcb94ef5cc0259791dcac4086
4 changes: 2 additions & 2 deletions sentry_sdk/integrations/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def patch_asyncio():
loop = asyncio.get_running_loop()
orig_task_factory = loop.get_task_factory()

def _sentry_task_factory(loop, coro):
def _sentry_task_factory(loop, coro, **kwargs):
# type: (Any, Any) -> Any

async def _coro_creating_hub_and_span():
Expand All @@ -56,7 +56,7 @@ async def _coro_creating_hub_and_span():

# Trying to use user set task factory (if there is one)
if orig_task_factory:
return orig_task_factory(loop, _coro_creating_hub_and_span())
return orig_task_factory(loop, _coro_creating_hub_and_span(), **kwargs)

# The default task factory in `asyncio` does not have its own function
# but is just a couple of lines in `asyncio.base_events.create_task()`
Expand Down