Skip to content

Commit 19cb677

Browse files
committed
hate mypy
1 parent b4b202f commit 19cb677

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sentry_sdk/tracing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
)
1414
from opentelemetry.trace.status import Status, StatusCode
1515
from opentelemetry.sdk.trace import ReadableSpan
16-
from opentelemetry.version import __version__ as _OTEL_VERSION
16+
from opentelemetry.version import __version__ as otel_version
1717

1818
import sentry_sdk
1919
from sentry_sdk.consts import (
@@ -72,7 +72,7 @@
7272
from sentry_sdk.tracing_utils import Baggage
7373

7474

75-
_OTEL_VERSION = parse_version(_OTEL_VERSION)
75+
_OTEL_VERSION = parse_version(otel_version)
7676

7777
tracer = otel_trace.get_tracer(__name__)
7878

@@ -535,7 +535,7 @@ def set_status(self, status):
535535
otel_status = StatusCode.ERROR
536536
otel_description = status
537537

538-
if _OTEL_VERSION >= (1, 12, 0):
538+
if _OTEL_VERSION is not None and _OTEL_VERSION >= (1, 12, 0):
539539
self._otel_span.set_status(otel_status, otel_description)
540540
else:
541541
self._otel_span.set_status(Status(otel_status, otel_description))

0 commit comments

Comments
 (0)