0iddlZddlZddlZddlmZddlmZmZddlm Z m Z m Z  ddl Z ddl mZddlmZmZer%ddlmZmZmZdd lmZdd lmZed ed ef ZdZdZdZdZGddeZy#e$r edwxYw)N)OP) Integration DidNotEnable)event_from_exceptionloggerreraise)Taskzasyncio not available)cast TYPE_CHECKING)AnyCallableTypeVar) Coroutine)ExcInfoT.)boundcBt|ddxst|ddxsdS)N __qualname____name__zcoroutine without __name__)getattr)coros N/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/asyncio.pyget_namers. nd+ ( 4T * ( 'cPtjtj|ddS)N)rr)wrappedassignedupdated) functoolspartialupdate_wrapper)rs r_wrap_coroutiner##s)     -  rcd tj}|jfd}|j|y#t$rt j dYywxYw)Nc"tfd}d}r||fi|}|,t|fd|i|}|jr |jd= td|j t d|S#t $rY|SwxYw)NcKd}tj5tjtjt t j5 d{}dddddd|S7#t$r}|dd}~wt$rttY>wxYw#1swYCxYw#1swY|SxYww)N)opnameorigin) sentry_sdkisolation_scope start_spanrFUNCTIONrAsyncioIntegrationr)StopAsyncIteration Exceptionr_capture_exception)resulters r_task_with_sentry_span_creationzTpatch_asyncio.._sentry_task_factory.._task_with_sentry_span_creation8s//1#..;;%d^188 ;+/ZF 2 &01."#-(;#%7%9:;2 spB?>B2B&A8A6 A8$B2, B?6A88 B#BB# B&"B##B&&B/ +B22B<7B?loopzasyncio.Task[Any]z (Sentry-wrapped))r#r _source_tracebackr set_namerAttributeError)r5rkwargsr4taskorig_task_factorys ` r_sentry_task_factoryz+patch_asyncio.._sentry_task_factory5sT " # &D!(9;?E|;=SDSFS))..r2 ($/88~&&78K " K  s'B B BzThere is no running asyncio loop so there is nothing Sentry can patch. Please make sure you call sentry_sdk.init() within a running asyncio loop for the AsyncioIntegration to work. See https://docs.sentry.io/platforms/python/integrations/asyncio/)asyncioget_running_loopget_task_factoryset_task_factory RuntimeErrorrwarning)r5r=r<s @r patch_asynciorD.sdC '') 1134 l 23   P  s:AA! A!ctj}tj}|j t }|5t ||jddd\}}tj|||S)Nr>F)typehandled)client_options mechanism)hint) sysexc_infor* get_clientget_integrationr.roptions capture_event)rLclient integrationeventrJs rr1r1wsi||~H  " " $F(();>(U; t   T2 Orc*eZdZdZdeZedZy)r.r>zauto.function.cty)N)rDrrr setup_oncezAsyncioIntegration.setup_onces  rN)r __module__r identifierr) staticmethodrVrrrr.r.s%Jj\ *Frr.) rKr r*sentry_sdk.constsrsentry_sdk.integrationsrrsentry_sdk.utilsrrrr> asyncio.tasksr ImportErrortypingr r r r rcollections.abcrsentry_sdk._typesrrrr#rDr1r.rrrrbs  =BB0"'--))8CH-.AF R${0 . //0s A77B