Skip to content

Commit

Permalink
fix(http2): Check for h2 existence (#3690)
Browse files Browse the repository at this point in the history
The new `HTTP2Transport` needs `httpcore` _and_ `h2` and we only checked for `httpcore`. This caused runtime errors and dropping of all events during testing as the test platform had `httpcore` installed but not `h2`. This patch adds both as conditions for the new transport implementation. Ideally, when we switch out the old transport, we'd silently check for `h2` existence only and set the `http2` option accordingly.
  • Loading branch information
BYK authored Oct 31, 2024
1 parent 02d0934 commit ce9986c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sentry_sdk/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ def _request(

try:
import httpcore
import h2 # type: ignore # noqa: F401
except ImportError:
# Sorry, no Http2Transport for you
class Http2Transport(HttpTransport):
Expand Down

0 comments on commit ce9986c

Please sign in to comment.