Skip to content

Commit

Permalink
better readable
Browse files Browse the repository at this point in the history
  • Loading branch information
antonpirker committed Dec 3, 2024
1 parent a42d7f5 commit cc9397d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sentry_sdk/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1313,11 +1313,11 @@ def __exit__(self, ty, value, tb):
if value is not None:
self.set_status(SPANSTATUS.INTERNAL_ERROR)
else:
status_already_set = (
not hasattr(self._otel_span, "status")
or self._otel_span.status.status_code != StatusCode.UNSET
status_unset = (
hasattr(self._otel_span, "status")
and self._otel_span.status.status_code == StatusCode.UNSET
)
if not status_already_set:
if status_unset:
self.set_status(SPANSTATUS.OK)

self.finish()
Expand Down

0 comments on commit cc9397d

Please sign in to comment.