Skip to content

Commit

Permalink
Patch eventlet under Sentry SDK (#2464)
Browse files Browse the repository at this point in the history
* Patch eventlet on Sentry SDK

* Update sequence

* Remove redundant stuff

Co-authored-by: Sergey Shepelev <[email protected]>

* fix codestyle

* Applied Black formatting to utils.py

---------

Co-authored-by: Guilherme Scaranse <[email protected]>
Co-authored-by: Sergey Shepelev <[email protected]>
  • Loading branch information
3 people authored Oct 25, 2023
1 parent 3176dde commit 39e3556
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sentry_sdk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1159,9 +1159,18 @@ def _is_contextvars_broken():
pass

try:
import greenlet # type: ignore
from eventlet.patcher import is_monkey_patched # type: ignore

if is_monkey_patched("thread"):
greenlet_version = parse_version(greenlet.__version__)

if greenlet_version is None:
logger.error(
"Internal error in Sentry SDK: Could not parse Greenlet version from greenlet.__version__."
)
return False

if is_monkey_patched("thread") and greenlet_version < (0, 5):
return True
except ImportError:
pass
Expand Down

0 comments on commit 39e3556

Please sign in to comment.