Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/integrations/pyramid/test_pyramid.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pytest
from pyramid.authorization import ACLAuthorizationPolicy
from pyramid.response import Response
from packaging.version import Version
from werkzeug.test import Client

from sentry_sdk import capture_message, add_breadcrumb
Expand All @@ -18,7 +19,7 @@
try:
from importlib.metadata import version

PYRAMID_VERSION = tuple(map(int, version("pyramid").split(".")))
PYRAMID_VERSION = Version(version("pyramid")).release

Check warning on line 22 in tests/integrations/pyramid/test_pyramid.py

View workflow job for this annotation

GitHub Actions / warden: code-review

Fallback code path in except block doesn't handle alpha suffixes

The PR fixes version parsing for Python 3.8+ by using `packaging.version.Version(...).release`, but the fallback `except ImportError` block (lines 26-30 for Python < 3.8) still uses `map(int, version.split('.'))` which will raise `ValueError` on versions with alpha suffixes like '2.0a1'. This inconsistency means the fix is incomplete - tests would still fail on Python 3.6/3.7 with alpha pyramid versions.

except ImportError:
# < py3.8
Expand Down
Loading