File tree 2 files changed +5
-13
lines changed
2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -722,12 +722,15 @@ def strip_string(value, max_length=None):
722
722
return value
723
723
724
724
725
- def _is_threading_local_monkey_patched ():
725
+ def _is_contextvars_broken ():
726
726
# type: () -> bool
727
727
try :
728
728
from gevent .monkey import is_object_patched # type: ignore
729
729
730
730
if is_object_patched ("threading" , "local" ):
731
+ if is_object_patched ("contextvars" , "ContextVar" ):
732
+ return False
733
+
731
734
return True
732
735
except ImportError :
733
736
pass
@@ -752,7 +755,7 @@ def _get_contextvars():
752
755
753
756
https://github.com/gevent/gevent/issues/1407
754
757
"""
755
- if not _is_threading_local_monkey_patched ():
758
+ if not _is_contextvars_broken ():
756
759
# aiocontextvars is a PyPI package that ensures that the contextvars
757
760
# backport (also a PyPI package) works with asyncio under Python 3.6
758
761
#
Original file line number Diff line number Diff line change 3
3
import time
4
4
5
5
6
- from sentry_sdk .utils import _is_threading_local_monkey_patched
7
-
8
-
9
- @pytest .mark .forked
10
- def test_thread_local_is_patched (maybe_monkeypatched_threading ):
11
- if maybe_monkeypatched_threading is None :
12
- assert not _is_threading_local_monkey_patched ()
13
- else :
14
- assert _is_threading_local_monkey_patched ()
15
-
16
-
17
6
@pytest .mark .forked
18
7
def test_leaks (maybe_monkeypatched_threading ):
19
8
import threading
You can’t perform that action at this time.
0 commit comments