Skip to content

Commit 309e6ef

Browse files
authored
Merge branch 'master' into szokeasaurusrex/recursion-depth
2 parents a547e17 + 7406113 commit 309e6ef

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

sentry_sdk/integrations/dramatiq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def before_process_message(self, broker, message):
9595
message._scope_manager.__enter__()
9696

9797
scope = sentry_sdk.get_current_scope()
98-
scope.transaction = message.actor_name
98+
scope.set_transaction_name(message.actor_name)
9999
scope.set_extra("dramatiq_message_id", message.message_id)
100100
scope.add_event_processor(_make_message_event_processor(message, integration))
101101

sentry_sdk/scope.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,11 @@ def set_transaction_name(self, name, source=None):
794794
def user(self, value):
795795
# type: (Optional[Dict[str, Any]]) -> None
796796
"""When set a specific user is bound to the scope. Deprecated in favor of set_user."""
797+
warnings.warn(
798+
"The `Scope.user` setter is deprecated in favor of `Scope.set_user()`.",
799+
DeprecationWarning,
800+
stacklevel=2,
801+
)
797802
self.set_user(value)
798803

799804
def set_user(self, value):

tests/test_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import pytest
88

99
import sentry_sdk
10+
from sentry_sdk._compat import PY38
1011
from sentry_sdk.integrations import Integration
1112
from sentry_sdk._queue import Queue
1213
from sentry_sdk.utils import (
@@ -901,6 +902,7 @@ def target():
901902
assert (main_thread.ident, main_thread.name) == results.get(timeout=1)
902903

903904

905+
@pytest.mark.skipif(PY38, reason="Flakes a lot on 3.8 in CI.")
904906
def test_get_current_thread_meta_failed_to_get_main_thread():
905907
results = Queue(maxsize=1)
906908

0 commit comments

Comments
 (0)