Skip to content

Commit

Permalink
Parse gevent version supporting non-numeric parts. (#1243)
Browse files Browse the repository at this point in the history
fixes #1163
  • Loading branch information
mgaitan committed Dec 1, 2021
1 parent df542a2 commit 9c72c22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sentry_sdk/utils.py
Expand Up @@ -792,7 +792,9 @@ def _is_contextvars_broken():
from gevent.monkey import is_object_patched # type: ignore

# Get the MAJOR and MINOR version numbers of Gevent
version_tuple = tuple([int(part) for part in gevent.__version__.split(".")[:2]])
version_tuple = tuple(
[int(part) for part in re.split(r"a|b|rc|\.", gevent.__version__)[:2]]
)
if is_object_patched("threading", "local"):
# Gevent 20.9.0 depends on Greenlet 0.4.17 which natively handles switching
# context vars when greenlets are switched, so, Gevent 20.9.0+ is all fine.
Expand Down

0 comments on commit 9c72c22

Please sign in to comment.