Skip to content

Commit 03a56a8

Browse files
szokeasaurusrexshellmayr
authored andcommitted
ref: Use set_client to change DSN (#92944)
`with sentry_sdk.init` is deprecated and will be removed in Sentry SDK 3.0. Split off from #92011 <!-- Describe your PR here. --> <!-- Sentry employees and contractors can delete or ignore the following. --> ### Legal Boilerplate Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
1 parent 0ef88f1 commit 03a56a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sentry/runner/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ def main() -> None:
135135
func(**kwargs)
136136
except Exception as e:
137137
# This reports errors sentry-devservices
138-
with sentry_sdk.init(dsn=os.environ["SENTRY_DEVSERVICES_DSN"]):
138+
with sentry_sdk.new_scope() as scope:
139+
scope.set_client(sentry_sdk.Client(dsn=os.environ["SENTRY_DEVSERVICES_DSN"]))
139140
if os.environ.get("USER"):
140141
sentry_sdk.set_user({"username": os.environ.get("USER")})
141142
sentry_sdk.capture_exception(e)

0 commit comments

Comments
 (0)