Skip to content

Commit ccdaed3

Browse files
authored
Make sure we're importing redis the library (#2106)
...not the module, if there is one present.
1 parent f805239 commit ccdaed3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sentry_sdk/integrations/redis.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ def __init__(self, max_data_size=_DEFAULT_MAX_DATA_SIZE):
115115
def setup_once():
116116
# type: () -> None
117117
try:
118-
import redis
118+
from redis import StrictRedis, client
119119
except ImportError:
120120
raise DidNotEnable("Redis client not installed")
121121

122-
patch_redis_client(redis.StrictRedis, is_cluster=False)
123-
patch_redis_pipeline(redis.client.Pipeline, False, _get_redis_command_args)
122+
patch_redis_client(StrictRedis, is_cluster=False)
123+
patch_redis_pipeline(client.Pipeline, False, _get_redis_command_args)
124124
try:
125-
strict_pipeline = redis.client.StrictPipeline # type: ignore
125+
strict_pipeline = client.StrictPipeline # type: ignore
126126
except AttributeError:
127127
pass
128128
else:

0 commit comments

Comments
 (0)