U \7@sTddlZddlmZddlmZmZddlmZGdddeZ ddZ d d Z dS) N)Hub)capture_internal_exceptionsevent_from_exception) Integrationc@seZdZdZeddZdS)ExcepthookIntegration excepthookcCsttjt_dS)N)_make_excepthooksysrr r /excepthook.py setup_oncesz ExcepthookIntegration.setup_onceN)__name__ __module__ __qualname__Z identifier staticmethodr r r r r r srcsfdd}|S)Nc sltj}|t}|dk r`tr`t6t|||f|jjdddd\}}|j ||dW5QRX|||S)NrF)typeZhandled)Zclient_optionsZ mechanism)hint) rZcurrentZget_integrationr _should_sendrrZclientZoptionsZ capture_event)exctypevalue tracebackZhubZ integrationZeventrold_excepthookr r sentry_sdk_excepthooks  z/_make_excepthook..sentry_sdk_excepthookr )rrr rr rs rcCsttdrdSdS)NZps1FT)hasattrr r r r r r(s r) r Zsentry_sdk.hubrZsentry_sdk.utilsrrZsentry_sdk.integrationsrCallablerrrr r r r s