diff --git a/sentry_sdk/integrations/stdlib.py b/sentry_sdk/integrations/stdlib.py index 1aad7a7e9a..2be48a5ba2 100644 --- a/sentry_sdk/integrations/stdlib.py +++ b/sentry_sdk/integrations/stdlib.py @@ -459,11 +459,8 @@ def close(self: "HTTPResponse") -> None: self._sentrysdk_span = None # type: ignore[attr-defined] _complete_span(span) - HTTPConnection.putrequest = putrequest # type: ignore[method-assign] - # patch `HTTPConnection.putrequest()` first. urllib3 < 1.25.9 inherits it, so - # wrapping AWS classes first would skip URL and span recording. Once boto3-v1.16.63 - # support is dropped, we won't have to worry about this issue. _patch_aws_connection() + HTTPConnection.putrequest = putrequest # type: ignore[method-assign] HTTPConnection.getresponse = getresponse # type: ignore[method-assign] HTTPResponse.read = read # type: ignore[method-assign] HTTPResponse.close = close # type: ignore[assignment,method-assign]