Skip to content

Commit 7ba0e84

Browse files
committed
Try regular imports
1 parent db4bdfb commit 7ba0e84

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

sentry_sdk/integrations/statsig.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@
44
from sentry_sdk.feature_flags import add_feature_flag
55
from sentry_sdk.integrations import Integration, DidNotEnable
66

7-
import importlib
8-
97
try:
10-
# The statsig package has the same name as this file. We use importlib to avoid conflicts.
11-
statsig = importlib.import_module("statsig.statsig")
8+
from statsig import statsig as statsig_module
129
except ImportError:
1310
raise DidNotEnable("statsig is not installed")
1411

1512
if TYPE_CHECKING:
16-
statsig_user = importlib.import_module("statsig.statsig_user")
17-
StatsigUser = statsig_user.StatsigUser
13+
from statsig.statsig_user import StatsigUser
1814

1915

2016
class StatsigIntegration(Integration):
@@ -24,7 +20,7 @@ class StatsigIntegration(Integration):
2420
def setup_once():
2521
# type: () -> None
2622
# Wrap and patch evaluation method(s) in the statsig module
27-
old_check_gate = statsig.check_gate
23+
old_check_gate = statsig_module.check_gate
2824

2925
@wraps(old_check_gate)
3026
def sentry_check_gate(user, gate, *args, **kwargs):
@@ -33,4 +29,4 @@ def sentry_check_gate(user, gate, *args, **kwargs):
3329
add_feature_flag(gate, enabled)
3430
return enabled
3531

36-
statsig.check_gate = sentry_check_gate
32+
statsig_module.check_gate = sentry_check_gate

0 commit comments

Comments
 (0)