0i"ddlZddlZddlmZddlmZmZddlmZm Z ddl Z ddl m Z ddl mZmZddlmZmZmZmZddlmZer7dd lmZdd lmZdd lmZdd lmZdd lmZededefZedeZGdde ZdZ dZ!dZ"y)Nwraps)Threadcurrent_thread)ThreadPoolExecutorFuture) Integrationuse_isolation_scope use_scope)event_from_exceptioncapture_internal_exceptionsloggerreraise) TYPE_CHECKING)Any)TypeVar)Callable)Optional)ExcInfoF.)boundTc(eZdZdZddZedZy)ThreadingIntegration threadingNcT|tjd||_|||_yy)NzLDeprecated: propagate_hub is deprecated. This will be removed in the future.)rwarningpropagate_scope)self propagate_hubrs P/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/threading.py__init__zThreadingIntegration.__init__"s4  $ NN^  /  $#0D  %chtj ddlm}ddl}|j }tjdkxr|duxr|dkxr|duxr |dk\xr|dktfd}|t_ttjt_ y#t $rd}d}YwxYw)Nr)VERSION) z4.0.0)r'r)rc Xtjjt}| |g|i|S|jrr@t j ddtj}tj}nItjj}tjj}nd}d}t5t||t|jd|j}||_ ddd|g|i|S#1swYxYw)NaVThere is a known issue with Django channels 2.x and 3.x when using Python 3.8 or older. (Async support is emulated using threads and some Sentry data may be leaked between those threads.) Please either upgrade to Django channels 4.0+, use Django's async features available in Django 3.1+ instead of Django channels, or upgrade to Python 3.9+.) stacklevel__func__) sentry_sdk get_clientget_integrationrrwarningswarnget_isolation_scopeget_current_scopeforkr _wrap_rungetattrrun) r akw integrationisolation_scope current_scopenew_runis_async_emulated_with_threads old_starts r" sentry_startz5ThreadingIntegration.setup_once..sentry_startIs%//1AABVWK" 00R00**1MMj$% '1&D&D&FO$.$@$@$BM'1&D&D&F&K&K&MO$.$@$@$B$G$G$IM"& $ -.##!DHHj$((; # /T,A,, ,/.s 4D  D)) rstartdjangor&channels __version__ ImportErrorsys version_infor _wrap_threadpool_executor_submitrsubmit)django_versionrDchannels_versionrAr?r@s @@r" setup_oncezThreadingIntegration.setup_once2sLL  $ 8 '33    v % ( , ( 7* (d* (&(  ( ' ' y ' - ' -R$ $D  % %'E% !q $!N#  $sB!! B10B1)NT)__name__ __module__ __qualname__ identifierr# staticmethodrMr$r"rrs"J1 C C r$rc6tfd}|S)Ncfd}31t5t5|cdddcdddS|S#1swYnxYw dddy#1swYyxYw)Ncv t}|gddiS#t$rttYywxYw)N)r Exceptionr_capture_exception)r r9r: old_run_funcs r"_run_old_run_funcz1_wrap_run..run.._run_old_run_func~sF /%'#D71QR57B77 /+-. /s 88r )r9r:r[current_scope_to_useisolation_scope_to_userZs`` r"r8z_wrap_run..run{sa / " -2F2R$%;<34,.54=<%& &544=<.sentry_submit..wrapped_fnse*}/H(9"=1!426221:9t&v& &211:99s! AA AA AA)r.r/r0rrr3r4r5) r rcrarbr;rdr=r<funcr?s ` @@r" sentry_submitz7_wrap_threadpool_executor_submit..sentry_submits!++-==>RS  b24262 2  & &+I(<<>O&88:M  ( ((<<>CCEO&88:??AM"O M 'D*6t6v66r$r)rer?rfs`` r"rIrIs#  4[776 r$ctj}tj}|j t 5t ||jddd\}}tj|||S)NrF)typehandled)client_options mechanism)hint) rGexc_infor.r/r0rr options capture_event)rmclienteventrls r"rYrYsd||~H  " " $F 23?* !>>*u= t   T2 Or$)#rGr1 functoolsrrrrconcurrent.futuresrrr.sentry_sdk.integrationsr sentry_sdk.scoper r sentry_sdk.utilsr rrrtypingrrrrrsentry_sdk._typesrrrrr6rIrYrSr$r"rys~ ,9/;!)8CH-.A3AW ;W t."J r$