Skip to content

Commit f63d40c

Browse files
committed
Cache is_gevent
1 parent 8278cf3 commit f63d40c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sentry_sdk/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from collections import namedtuple
1414
from datetime import datetime, timezone
1515
from decimal import Decimal
16-
from functools import partial, partialmethod, wraps
16+
from functools import lru_cache, partial, partialmethod, wraps
1717
from numbers import Real
1818
from urllib.parse import parse_qs, unquote, urlencode, urlsplit, urlunsplit
1919

@@ -1858,6 +1858,7 @@ def is_module_patched(mod_name):
18581858
return False
18591859

18601860

1861+
@lru_cache(maxsize=1)
18611862
def is_gevent():
18621863
# type: () -> bool
18631864
return is_module_patched("threading") or is_module_patched("_thread")

0 commit comments

Comments
 (0)