Skip to content

Commit

Permalink
Remove redundant stuff
Browse files Browse the repository at this point in the history
Co-authored-by: Sergey Shepelev <temotor@gmail.com>
  • Loading branch information
guiscaranse and temoto committed Jun 17, 2022
1 parent 7d9cba5 commit 7acc29f
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions sentry_sdk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,6 @@ def _is_contextvars_broken():
import greenlet
from eventlet.patcher import is_monkey_patched # type: ignore

if is_monkey_patched("thread"):
version_tuple = tuple([int(part) for part in greenlet.__version__.split(".")[:2]])
if is_monkey_patched("thread") and version_tuple < (0, 5):
return True
Expand Down Expand Up @@ -873,26 +872,14 @@ def _get_contextvars():
pass
else:
# On Python 3.7 contextvars are functional.
# Special check for eventlet
try:
import eventlet # type: ignore
from eventlet.patcher import is_monkey_patched # type: ignore
if is_monkey_patched('thread'):
contextvars = eventlet.import_patched('contextvars')
return True, contextvars.ContextVar
except ImportError:
pass

try:
from contextvars import ContextVar

return True, ContextVar
except ImportError:
pass


# Fall back to basic thread-local usage.

from threading import local

return False, _make_threadlocal_contextvars(local)
Expand Down

0 comments on commit 7acc29f

Please sign in to comment.