Skip to content

Commit 0e6723e

Browse files
committed
Amend ExceptionWithTraceback import
1 parent 8bff977 commit 0e6723e

File tree

2 files changed

+5
-10
lines changed
  • instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery

2 files changed

+5
-10
lines changed

instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ def add(x, y):
7777
from opentelemetry.semconv.trace import SpanAttributes
7878
from opentelemetry.trace.status import Status, StatusCode
7979

80-
ExceptionWithTraceback = utils.import_exception_with_traceback()
80+
81+
if VERSION >= (4, 0, 1):
82+
from billiard.einfo import ExceptionWithTraceback
83+
else:
84+
ExceptionWithTraceback = None
8185

8286
logger = logging.getLogger(__name__)
8387

instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/utils.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,6 @@
4848
)
4949

5050

51-
def import_exception_with_traceback():
52-
if VERSION >= (4, 0, 1):
53-
from billiard.einfo import ExceptionWithTraceback
54-
55-
return ExceptionWithTraceback
56-
57-
return None
58-
59-
6051
# pylint:disable=too-many-branches
6152
def set_attributes_from_context(span, context):
6253
"""Helper to extract meta values from a Celery Context"""

0 commit comments

Comments
 (0)