File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed
Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ def iter_default_integrations(with_auto_enabling_integrations):
6363 "sentry_sdk.integrations.aiohttp.AioHttpIntegration" ,
6464 "sentry_sdk.integrations.tornado.TornadoIntegration" ,
6565 "sentry_sdk.integrations.sqlalchemy.SqlalchemyIntegration" ,
66+ "sentry_sdk.integrations.redis.RedisIntegration" ,
67+ "sentry_sdk.integrations.pyramid.PyramidIntegration" ,
6668)
6769
6870
Original file line number Diff line number Diff line change 44import sys
55import weakref
66
7- from pyramid .httpexceptions import HTTPException
8- from pyramid .request import Request
9-
107from sentry_sdk .hub import Hub , _should_send_default_pii
118from sentry_sdk .utils import capture_internal_exceptions , event_from_exception
129from sentry_sdk ._compat import reraise , iteritems
1310
14- from sentry_sdk .integrations import Integration
11+ from sentry_sdk .integrations import Integration , DidNotEnable
1512from sentry_sdk .integrations ._wsgi_common import RequestExtractor
1613from sentry_sdk .integrations .wsgi import SentryWsgiMiddleware
1714
15+ try :
16+ from pyramid .httpexceptions import HTTPException
17+ from pyramid .request import Request
18+ except ImportError :
19+ raise DidNotEnable ("Pyramid not installed" )
20+
1821from sentry_sdk ._types import MYPY
1922
2023if MYPY :
@@ -64,7 +67,6 @@ def __init__(self, transaction_style="route_name"):
6467 def setup_once ():
6568 # type: () -> None
6669 from pyramid import router
67- from pyramid .request import Request
6870
6971 old_call_view = router ._call_view
7072
Original file line number Diff line number Diff line change 22
33from sentry_sdk import Hub
44from sentry_sdk .utils import capture_internal_exceptions
5- from sentry_sdk .integrations import Integration
5+ from sentry_sdk .integrations import Integration , DidNotEnable
66
77from sentry_sdk ._types import MYPY
88
@@ -16,7 +16,10 @@ class RedisIntegration(Integration):
1616 @staticmethod
1717 def setup_once ():
1818 # type: () -> None
19- import redis
19+ try :
20+ import redis
21+ except ImportError :
22+ raise DidNotEnable ("Redis client not installed" )
2023
2124 patch_redis_client (redis .StrictRedis )
2225
You can’t perform that action at this time.
0 commit comments