Skip to content

Commit cc9397d

Browse files
committed
better readable
1 parent a42d7f5 commit cc9397d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sentry_sdk/tracing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,11 +1313,11 @@ def __exit__(self, ty, value, tb):
13131313
if value is not None:
13141314
self.set_status(SPANSTATUS.INTERNAL_ERROR)
13151315
else:
1316-
status_already_set = (
1317-
not hasattr(self._otel_span, "status")
1318-
or self._otel_span.status.status_code != StatusCode.UNSET
1316+
status_unset = (
1317+
hasattr(self._otel_span, "status")
1318+
and self._otel_span.status.status_code == StatusCode.UNSET
13191319
)
1320-
if not status_already_set:
1320+
if status_unset:
13211321
self.set_status(SPANSTATUS.OK)
13221322

13231323
self.finish()

0 commit comments

Comments
 (0)