diff --git a/coolamqp/attaches/utils.py b/coolamqp/attaches/utils.py index 97ae562c76a80795e71a9ef2a2c8becdd2532a95..603f89105451a589d554145cc6a1c330a19297fa 100644 --- a/coolamqp/attaches/utils.py +++ b/coolamqp/attaches/utils.py @@ -13,6 +13,11 @@ def close_future(fut: Future, span): # type: (Future, opentracing.Span) -> Futu """ To be called as a Future callback, means to close the span """ + try: + import opentracing + except ImportError: + return fut + def inner_close(fut): exc = fut.exception() if exc is not None: