Skip to content

Commit

Permalink
Added backwards compat for setting daemon in py_versions < 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedetefy committed Jun 14, 2021
1 parent 3bd3199 commit aab17cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sentry_sdk/worker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys
import threading

from time import sleep, time
Expand Down Expand Up @@ -66,7 +67,10 @@ def start(self):
self._thread = threading.Thread(
target=self._target, name="raven-sentry.BackgroundWorker"
)
self._thread.daemon = True
if sys.version_info < (3, 10):
self._thread.setDaemon(True)
else:
self._thread.daemon = True
self._thread.start()
self._thread_for_pid = os.getpid()

Expand Down

0 comments on commit aab17cb

Please sign in to comment.