Skip to content

Commit

Permalink
Fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
antonpirker committed Feb 19, 2024
1 parent 7d9c51d commit 6df29bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
12 changes: 8 additions & 4 deletions sentry_sdk/integrations/threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ def sentry_start(self, *a, **kw):
# In threading module, using current_thread API will access current thread instance
# without holding it to avoid a reference cycle in an easier way.
with capture_internal_exceptions():
new_run = _wrap_run(isolation_scope, current_scope, getattr(self.run, "__func__", self.run))
new_run = _wrap_run(
isolation_scope,
current_scope,
getattr(self.run, "__func__", self.run),
)
self.run = new_run # type: ignore

return old_start(self, *a, **kw)
Expand All @@ -88,12 +92,12 @@ def _run_old_run_func():
except Exception:
reraise(*_capture_exception())

if isolation_scope_to_use is None and current_scope_to_use is None:
return _run_old_run_func()
else:
if isolation_scope_to_use is not None and current_scope_to_use is not None:
with use_isolation_scope(isolation_scope_to_use):
with use_scope(current_scope_to_use):
return _run_old_run_func()
else:
return _run_old_run_func()

return run # type: ignore

Expand Down
5 changes: 0 additions & 5 deletions tests/integrations/threading/test_threading.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import gc
import sys
from concurrent import futures
from threading import Thread

Expand All @@ -12,10 +11,6 @@
original_start = Thread.start
original_run = Thread.run

minimum_python_37 = pytest.mark.skipif(
sys.version_info < (3, 7), reason="Test needs Python >= 3.7"
)


@pytest.mark.parametrize("integrations", [[ThreadingIntegration()], []])
def test_handles_exceptions(sentry_init, capture_events, integrations):
Expand Down

0 comments on commit 6df29bc

Please sign in to comment.