Skip to content

Commit

Permalink
Amend ExceptionWithTraceback import
Browse files Browse the repository at this point in the history
  • Loading branch information
unflxw committed Sep 1, 2023
1 parent d09933a commit fb909ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,13 @@ def add(x, y):
from opentelemetry.propagators.textmap import Getter
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace.status import Status, StatusCode
from billiard import VERSION

ExceptionWithTraceback = utils.import_exception_with_traceback()

if VERSION >= (4, 0, 1):
from billiard.einfo import ExceptionWithTraceback
else:
ExceptionWithTraceback = None

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@
)


def import_exception_with_traceback():
if VERSION >= (4, 0, 1):
from billiard.einfo import ExceptionWithTraceback

return ExceptionWithTraceback

return None


# pylint:disable=too-many-branches
def set_attributes_from_context(span, context):
"""Helper to extract meta values from a Celery Context"""
Expand Down

0 comments on commit fb909ed

Please sign in to comment.