Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch eventlet under Sentry SDK #2464

Merged
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 @@
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__)

Check warning on line 1165 in sentry_sdk/utils.py

View check run for this annotation

Codecov / codecov/patch

sentry_sdk/utils.py#L1165

Added line #L1165 was not covered by tests

if greenlet_version is None:
logger.error(

Check warning on line 1168 in sentry_sdk/utils.py

View check run for this annotation

Codecov / codecov/patch

sentry_sdk/utils.py#L1168

Added line #L1168 was not covered by tests
"Internal error in Sentry SDK: Could not parse Greenlet version from greenlet.__version__."
)
return False

Check warning on line 1171 in sentry_sdk/utils.py

View check run for this annotation

Codecov / codecov/patch

sentry_sdk/utils.py#L1171

Added line #L1171 was not covered by tests

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