Skip to content

Commit 1106fe4

Browse files
use non-deprecated function
1 parent 224d4a4 commit 1106fe4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

sentry_sdk/integrations/stdlib.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ def getresponse(self: "HTTPConnection", *args: "Any", **kwargs: "Any") -> "Any":
181181
span.set_http_status(int(rv.status))
182182
span.set_data("reason", rv.reason)
183183
finally:
184-
span.finish()
184+
if isinstance(span, StreamedSpan):
185+
span.end()
186+
else:
187+
span.finish()
185188

186189
with capture_internal_exceptions():
187190
add_http_request_source(span)

0 commit comments

Comments
 (0)