Skip to content

Commit c82663e

Browse files
committed
fix: Allow contextvars backport for Tornado as well
1 parent 253395c commit c82663e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sentry_sdk/integrations/tornado.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from sentry_sdk.hub import Hub, _should_send_default_pii
66
from sentry_sdk.utils import (
7+
HAS_REAL_CONTEXTVARS,
78
event_from_exception,
89
capture_internal_exceptions,
910
transaction_from_function,
@@ -39,11 +40,11 @@ def setup_once():
3940
if tornado_version is None or tornado_version < (5, 0):
4041
raise RuntimeError("Tornado 5+ required")
4142

42-
if sys.version_info < (3, 7):
43+
if not HAS_REAL_CONTEXTVARS:
4344
# Tornado is async. We better have contextvars or we're going to leak
4445
# state between requests.
4546
raise RuntimeError(
46-
"The tornado integration for Sentry requires Python 3.7+"
47+
"The tornado integration for Sentry requires Python 3.6+ or the aiocontextvars package"
4748
)
4849

4950
ignore_logger("tornado.application")

0 commit comments

Comments
 (0)