Skip to content

Commit

Permalink
Checking for correct exception and simplified logic on is_asyncio_cor…
Browse files Browse the repository at this point in the history
…outine function
  • Loading branch information
Nicholas Amorim committed Jun 17, 2019
1 parent 5c88b14 commit 6bbcf2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opentracing_instrumentation/local_span.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
try:
import asyncio
_ASYNCIO = True
except Exception:
except ImportError:
_ASYNCIO = False


def is_asyncio_coroutine(func):
return False if not _ASYNCIO else asyncio.iscoroutine(func)
return _ASYNCIO and asyncio.iscoroutine(func)


def func_span(func, tags=None, require_active_trace=False):
Expand Down

0 comments on commit 6bbcf2c

Please sign in to comment.