Skip to content

Commit 00fdce8

Browse files
authored
chore: add version checking to django channels (#15484)
## Description <!-- Provide an overview of the change and motivation for the change --> Quick fix for version checking for django channels, to fix `AttributeError` when `__version__` not found ## Testing <!-- Describe your testing strategy or note what tests are included --> ## Risks <!-- Note any risks associated with this change, or "None" if no risks --> ## Additional Notes <!-- Any other information that would be helpful for reviewers -->
1 parent 416cac0 commit 00fdce8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ddtrace/contrib/internal/django/patch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,8 @@ def _(m):
473473
def _(m):
474474
import channels
475475

476-
channels_version = parse_version(channels.__version__)
476+
channels_version_str = getattr(channels, "__version__", "")
477+
channels_version = parse_version(channels_version_str)
477478
if channels_version >= parse_version("3.0"):
478479
# ASGI3 is only supported in channels v3.0+
479480
trace_utils.wrap(m, "URLRouter.__init__", unwrap_views)

0 commit comments

Comments
 (0)