5454 Union ,
5555 )
5656
57+ from gevent .hub import Hub
58+
5759 import sentry_sdk .integrations
5860 from sentry_sdk ._types import Event , ExcInfo
5961
@@ -1182,8 +1184,8 @@ def _is_contextvars_broken():
11821184 Returns whether gevent/eventlet have patched the stdlib in a way where thread locals are now more "correct" than contextvars.
11831185 """
11841186 try :
1185- import gevent # type: ignore
1186- from gevent .monkey import is_object_patched # type: ignore
1187+ import gevent
1188+ from gevent .monkey import is_object_patched
11871189
11881190 # Get the MAJOR and MINOR version numbers of Gevent
11891191 version_tuple = tuple (
@@ -1209,7 +1211,7 @@ def _is_contextvars_broken():
12091211 pass
12101212
12111213 try :
1212- import greenlet # type: ignore
1214+ import greenlet
12131215 from eventlet .patcher import is_monkey_patched # type: ignore
12141216
12151217 greenlet_version = parse_version (greenlet .__version__ )
@@ -1794,12 +1796,14 @@ def now():
17941796 from gevent .monkey import is_module_patched
17951797except ImportError :
17961798
1797- def get_gevent_hub ():
1798- # type: () -> Any
1799+ # it's not great that the signatures are different, get_hub can't return None
1800+ # consider adding an if TYPE_CHECKING to change the signature to Optional[Hub]
1801+ def get_gevent_hub (): # type: ignore[misc]
1802+ # type: () -> Optional[Hub]
17991803 return None
18001804
1801- def is_module_patched (* args , ** kwargs ):
1802- # type: (*Any, **Any ) -> bool
1805+ def is_module_patched (mod_name ):
1806+ # type: (str ) -> bool
18031807 # unable to import from gevent means no modules have been patched
18041808 return False
18051809
0 commit comments