Skip to content

Commit 032cfd6

Browse files
committed
fix(http2): Check for h2 existence
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.
1 parent ec88aa9 commit 032cfd6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sentry_sdk/transport.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,7 @@ def _request(
720720

721721
try:
722722
import httpcore
723+
import h2 # type: ignore
723724
except ImportError:
724725
# Sorry, no Http2Transport for you
725726
class Http2Transport(HttpTransport):

0 commit comments

Comments
 (0)