Skip to content

Commit e9e7238

Browse files
build(deps): bump mypy from 0.761 to 0.770 (getsentry#645)
1 parent 03a5e65 commit e9e7238

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

linter-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
black==19.10b0
22
flake8
33
flake8-import-order
4-
mypy==0.761
4+
mypy==0.770
55
flake8-bugbear>=19.8.0
66
pep8-naming

sentry_sdk/integrations/excepthook.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,8 @@
1313

1414
from types import TracebackType
1515

16-
from mypy_extensions import Arg
17-
1816
Excepthook = Callable[
19-
[
20-
Arg(Type[BaseException], "type_"),
21-
Arg(BaseException, "value"),
22-
Arg(TracebackType, "traceback"),
23-
],
24-
None,
17+
[Type[BaseException], BaseException, TracebackType], Any,
2518
]
2619

2720

sentry_sdk/integrations/tornado.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from sentry_sdk._compat import iteritems
1919

2020
try:
21-
from tornado import version_info as TORNADO_VERSION
21+
from tornado import version_info as TORNADO_VERSION # type: ignore
2222
from tornado.web import RequestHandler, HTTPError
2323
from tornado.gen import coroutine
2424
except ImportError:
@@ -53,7 +53,7 @@ def setup_once():
5353

5454
ignore_logger("tornado.access")
5555

56-
old_execute = RequestHandler._execute
56+
old_execute = RequestHandler._execute # type: ignore
5757

5858
awaitable = iscoroutinefunction(old_execute)
5959

@@ -72,7 +72,8 @@ async def sentry_execute_request_handler(self, *args, **kwargs):
7272
with Hub(hub) as hub:
7373
with hub.configure_scope() as scope:
7474
scope.clear_breadcrumbs()
75-
scope.add_event_processor(_make_event_processor(weak_handler))
75+
processor = _make_event_processor(weak_handler) # type: ignore
76+
scope.add_event_processor(processor)
7677
return await old_execute(self, *args, **kwargs)
7778

7879
else:
@@ -89,20 +90,22 @@ def sentry_execute_request_handler(self, *args, **kwargs):
8990

9091
with Hub(hub) as hub:
9192
with hub.configure_scope() as scope:
92-
scope.add_event_processor(_make_event_processor(weak_handler))
93+
scope.clear_breadcrumbs()
94+
processor = _make_event_processor(weak_handler) # type: ignore
95+
scope.add_event_processor(processor)
9396
result = yield from old_execute(self, *args, **kwargs)
9497
return result
9598

96-
RequestHandler._execute = sentry_execute_request_handler
99+
RequestHandler._execute = sentry_execute_request_handler # type: ignore
97100

98101
old_log_exception = RequestHandler.log_exception
99102

100103
def sentry_log_exception(self, ty, value, tb, *args, **kwargs):
101104
# type: (Any, type, BaseException, Any, *Any, **Any) -> Optional[Any]
102105
_capture_exception(ty, value, tb)
103-
return old_log_exception(self, ty, value, tb, *args, **kwargs)
106+
return old_log_exception(self, ty, value, tb, *args, **kwargs) # type: ignore
104107

105-
RequestHandler.log_exception = sentry_log_exception
108+
RequestHandler.log_exception = sentry_log_exception # type: ignore
106109

107110

108111
def _capture_exception(ty, value, tb):

sentry_sdk/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ def current_stacktrace(with_locals=True):
464464
__tracebackhide__ = True
465465
frames = []
466466

467-
f = sys._getframe()
467+
f = sys._getframe() # type: Optional[FrameType]
468468
while f is not None:
469469
if not should_hide_frame(f):
470470
frames.append(serialize_frame(f, with_locals=with_locals))

0 commit comments

Comments
 (0)