$37 GRAYBYTE WORDPRESS FILE MANAGER $76

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.162.162 | ADMIN IP 216.73.216.174
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/

HOME
Current File : /opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations//sys_exit.py
import functools
import sys

import sentry_sdk
from sentry_sdk.utils import capture_internal_exceptions, event_from_exception
from sentry_sdk.integrations import Integration
from sentry_sdk._types import TYPE_CHECKING

if TYPE_CHECKING:
    from collections.abc import Callable
    from typing import NoReturn, Union


class SysExitIntegration(Integration):
    """Captures sys.exit calls and sends them as events to Sentry.

    By default, SystemExit exceptions are not captured by the SDK. Enabling this integration will capture SystemExit
    exceptions generated by sys.exit calls and send them to Sentry.

    This integration, in its default configuration, only captures the sys.exit call if the exit code is a non-zero and
    non-None value (unsuccessful exits). Pass `capture_successful_exits=True` to capture successful exits as well.
    Note that the integration does not capture SystemExit exceptions raised outside a call to sys.exit.
    """

    identifier = "sys_exit"

    def __init__(self, *, capture_successful_exits=False):
        # type: (bool) -> None
        self._capture_successful_exits = capture_successful_exits

    @staticmethod
    def setup_once():
        # type: () -> None
        SysExitIntegration._patch_sys_exit()

    @staticmethod
    def _patch_sys_exit():
        # type: () -> None
        old_exit = sys.exit  # type: Callable[[Union[str, int, None]], NoReturn]

        @functools.wraps(old_exit)
        def sentry_patched_exit(__status=0):
            # type: (Union[str, int, None]) -> NoReturn
            # @ensure_integration_enabled ensures that this is non-None
            integration = sentry_sdk.get_client().get_integration(SysExitIntegration)
            if integration is None:
                old_exit(__status)

            try:
                old_exit(__status)
            except SystemExit as e:
                with capture_internal_exceptions():
                    if integration._capture_successful_exits or __status not in (
                        0,
                        None,
                    ):
                        _capture_exception(e)
                raise e

        sys.exit = sentry_patched_exit


def _capture_exception(exc):
    # type: (SystemExit) -> None
    event, hint = event_from_exception(
        exc,
        client_options=sentry_sdk.get_client().options,
        mechanism={"type": SysExitIntegration.identifier, "handled": False},
    )
    sentry_sdk.capture_event(event, hint=hint)


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Dec 2025 9.30 AM
root / root
0755
__pycache__
--
3 Dec 2025 9.30 AM
root / root
0755
celery
--
3 Dec 2025 9.30 AM
root / root
0755
django
--
3 Dec 2025 9.30 AM
root / root
0755
google_genai
--
3 Dec 2025 9.30 AM
root / root
0755
grpc
--
3 Dec 2025 9.30 AM
root / root
0755
openai_agents
--
3 Dec 2025 9.30 AM
root / root
0755
opentelemetry
--
3 Dec 2025 9.30 AM
root / root
0755
pydantic_ai
--
3 Dec 2025 9.30 AM
root / root
0755
redis
--
3 Dec 2025 9.30 AM
root / root
0755
spark
--
3 Dec 2025 9.30 AM
root / root
0755
__init__.py
12.437 KB
3 Dec 2025 9.30 AM
root / root
0644
_asgi_common.py
3.112 KB
3 Dec 2025 9.30 AM
root / root
0644
_wsgi_common.py
7.381 KB
3 Dec 2025 9.30 AM
root / root
0644
aiohttp.py
12.702 KB
3 Dec 2025 9.30 AM
root / root
0644
anthropic.py
14.172 KB
3 Dec 2025 9.30 AM
root / root
0644
argv.py
0.89 KB
3 Dec 2025 9.30 AM
root / root
0644
ariadne.py
5.697 KB
3 Dec 2025 9.30 AM
root / root
0644
arq.py
7.696 KB
3 Dec 2025 9.30 AM
root / root
0644
asgi.py
12.5 KB
3 Dec 2025 9.30 AM
root / root
0644
asyncio.py
4.502 KB
3 Dec 2025 9.30 AM
root / root
0644
asyncpg.py
6.368 KB
3 Dec 2025 9.30 AM
root / root
0644
atexit.py
1.613 KB
3 Dec 2025 9.30 AM
root / root
0644
aws_lambda.py
17.647 KB
3 Dec 2025 9.30 AM
root / root
0644
beam.py
5.061 KB
3 Dec 2025 9.30 AM
root / root
0644
boto3.py
4.308 KB
3 Dec 2025 9.30 AM
root / root
0644
bottle.py
6.46 KB
3 Dec 2025 9.30 AM
root / root
0644
chalice.py
4.589 KB
3 Dec 2025 9.30 AM
root / root
0644
clickhouse_driver.py
5.955 KB
3 Dec 2025 9.30 AM
root / root
0644
cloud_resource_context.py
7.598 KB
3 Dec 2025 9.30 AM
root / root
0644
cohere.py
9.181 KB
3 Dec 2025 9.30 AM
root / root
0644
dedupe.py
1.929 KB
3 Dec 2025 9.30 AM
root / root
0644
dramatiq.py
7.28 KB
3 Dec 2025 9.30 AM
root / root
0644
excepthook.py
2.352 KB
3 Dec 2025 9.30 AM
root / root
0644
executing.py
1.947 KB
3 Dec 2025 9.30 AM
root / root
0644
falcon.py
9.278 KB
3 Dec 2025 9.30 AM
root / root
0644
fastapi.py
4.481 KB
3 Dec 2025 9.30 AM
root / root
0644
flask.py
8.535 KB
3 Dec 2025 9.30 AM
root / root
0644
gcp.py
8.264 KB
3 Dec 2025 9.30 AM
root / root
0644
gnu_backtrace.py
2.746 KB
3 Dec 2025 9.30 AM
root / root
0644
gql.py
4.688 KB
3 Dec 2025 9.30 AM
root / root
0644
graphene.py
4.924 KB
3 Dec 2025 9.30 AM
root / root
0644
httpx.py
5.943 KB
3 Dec 2025 9.30 AM
root / root
0644
huey.py
5.315 KB
3 Dec 2025 9.30 AM
root / root
0644
huggingface_hub.py
14.602 KB
3 Dec 2025 9.30 AM
root / root
0644
langchain.py
39.021 KB
3 Dec 2025 9.30 AM
root / root
0644
langgraph.py
11.558 KB
3 Dec 2025 9.30 AM
root / root
0644
launchdarkly.py
1.889 KB
3 Dec 2025 9.30 AM
root / root
0644
litellm.py
9.988 KB
3 Dec 2025 9.30 AM
root / root
0644
litestar.py
11.553 KB
3 Dec 2025 9.30 AM
root / root
0644
logging.py
13.566 KB
3 Dec 2025 9.30 AM
root / root
0644
loguru.py
6.381 KB
3 Dec 2025 9.30 AM
root / root
0644
mcp.py
19.582 KB
3 Dec 2025 9.30 AM
root / root
0644
modules.py
0.801 KB
3 Dec 2025 9.30 AM
root / root
0644
openai.py
24.542 KB
3 Dec 2025 9.30 AM
root / root
0644
openfeature.py
1.104 KB
3 Dec 2025 9.30 AM
root / root
0644
otlp.py
3.056 KB
3 Dec 2025 9.30 AM
root / root
0644
pure_eval.py
4.497 KB
3 Dec 2025 9.30 AM
root / root
0644
pymongo.py
6.23 KB
3 Dec 2025 9.30 AM
root / root
0644
pyramid.py
7.191 KB
3 Dec 2025 9.30 AM
root / root
0644
quart.py
7.239 KB
3 Dec 2025 9.30 AM
root / root
0644
ray.py
5.198 KB
3 Dec 2025 9.30 AM
root / root
0644
rq.py
5.183 KB
3 Dec 2025 9.30 AM
root / root
0644
rust_tracing.py
8.865 KB
3 Dec 2025 9.30 AM
root / root
0644
sanic.py
12.656 KB
3 Dec 2025 9.30 AM
root / root
0644
serverless.py
1.762 KB
3 Dec 2025 9.30 AM
root / root
0644
socket.py
3.095 KB
3 Dec 2025 9.30 AM
root / root
0644
sqlalchemy.py
4.242 KB
3 Dec 2025 9.30 AM
root / root
0644
starlette.py
25.623 KB
3 Dec 2025 9.30 AM
root / root
0644
starlite.py
10.312 KB
3 Dec 2025 9.30 AM
root / root
0644
statsig.py
1.198 KB
3 Dec 2025 9.30 AM
root / root
0644
stdlib.py
8.758 KB
3 Dec 2025 9.30 AM
root / root
0644
strawberry.py
13.823 KB
3 Dec 2025 9.30 AM
root / root
0644
sys_exit.py
2.435 KB
3 Dec 2025 9.30 AM
root / root
0644
threading.py
6.942 KB
3 Dec 2025 9.30 AM
root / root
0644
tornado.py
7.037 KB
3 Dec 2025 9.30 AM
root / root
0644
trytond.py
1.612 KB
3 Dec 2025 9.30 AM
root / root
0644
typer.py
1.772 KB
3 Dec 2025 9.30 AM
root / root
0644
unleash.py
1.033 KB
3 Dec 2025 9.30 AM
root / root
0644
unraisablehook.py
1.712 KB
3 Dec 2025 9.30 AM
root / root
0644
wsgi.py
10.556 KB
3 Dec 2025 9.30 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF