Skip to content

Commit d34f796

Browse files
committed
make more future proof
1 parent 47aafc9 commit d34f796

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sentry_sdk/integrations/threading.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,14 @@ def setup_once() -> None:
5454

5555
try:
5656
from django import VERSION as django_version # noqa: N811
57+
except ImportError:
58+
django_version = None
59+
60+
try:
5761
import channels # type: ignore[import-untyped]
5862

5963
channels_version = channels.__version__
6064
except (ImportError, AttributeError):
61-
django_version = None
6265
channels_version = None
6366

6467
is_async_emulated_with_threads = (

0 commit comments

Comments
 (0)