Skip to content

Commit 3b85ef4

Browse files
committed
Better error message
1 parent 6982479 commit 3b85ef4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sentry_sdk/integrations/threading.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,14 @@ def sentry_start(self, *a, **kw):
5858
return old_start(self, *a, **kw)
5959

6060
if integration.propagate_scope:
61-
django_version = None
62-
channels_version = None
6361
try:
6462
from django import VERSION as django_version # noqa: N811
6563
import channels
6664

6765
channels_version = channels.__version__
6866
except ImportError:
69-
pass
67+
django_version = None
68+
channels_version = None
7069

7170
if (
7271
sys.version_info <= (3, 8)
@@ -77,9 +76,10 @@ def sentry_start(self, *a, **kw):
7776
and django_version < (4, 0)
7877
):
7978
warnings.warn(
80-
"Sentry is not supported with Django channels 2.x and 3.x. when using Python 3.8 or older. "
81-
"Please either upgrade to Django channels 4.x or later, or upgrade to Python 3.9 or later.",
82-
DeprecationWarning,
79+
"There is a known issue with Django channels 2.x and 3.x when using Python 3.8 or older. "
80+
"(Async support is emulated using threads and some Sentry data may be leaked between those threads.) "
81+
"Please either upgrade to Django channels 4.x or later, use Django's async features "
82+
"available in Django 3.1 and later, or upgrade to Python 3.9 or later.",
8383
stacklevel=2,
8484
)
8585
isolation_scope = sentry_sdk.get_isolation_scope()

0 commit comments

Comments
 (0)