diff --git a/sentry_sdk/integrations/trytond.py b/sentry_sdk/integrations/trytond.py index 03e71734da..382e7385e2 100644 --- a/sentry_sdk/integrations/trytond.py +++ b/sentry_sdk/integrations/trytond.py @@ -2,10 +2,13 @@ from sentry_sdk.integrations import Integration from sentry_sdk.integrations.wsgi import SentryWsgiMiddleware from sentry_sdk.utils import ensure_integration_enabled, event_from_exception +from sentry_sdk.integrations import DidNotEnable -from trytond.exceptions import TrytonException # type: ignore -from trytond.wsgi import app # type: ignore - +try: + from trytond.exceptions import TrytonException # type: ignore + from trytond.wsgi import app # type: ignore +except ImportError: + raise DidNotEnable("Trytond is not installed.") # TODO: trytond-worker, trytond-cron and trytond-admin intergations diff --git a/tests/test_shadowed_module.py b/tests/test_shadowed_module.py index e1171dd103..34bb7917f4 100644 --- a/tests/test_shadowed_module.py +++ b/tests/test_shadowed_module.py @@ -35,7 +35,6 @@ def pytest_generate_tests(metafunc): "opentelemetry", "pure_eval", "ray", - "trytond", "typer", }, )