mirror of https://github.com/django/django.git
Refs #32074 -- Removed usage of deprecated Thread.setDaemon().
Thread.setDaemon() was deprecated in Python 3.10 and will be removed in Python 3.12.
This commit is contained in:
parent
623c8cd8f4
commit
f9f6bd63c9
|
@ -610,7 +610,7 @@ def start_django(reloader, main_func, *args, **kwargs):
|
|||
|
||||
main_func = check_errors(main_func)
|
||||
django_main_thread = threading.Thread(target=main_func, args=args, kwargs=kwargs, name='django-main-thread')
|
||||
django_main_thread.setDaemon(True)
|
||||
django_main_thread.daemon = True
|
||||
django_main_thread.start()
|
||||
|
||||
while not reloader.should_stop:
|
||||
|
|
|
@ -364,7 +364,7 @@ class StartDjangoTests(SimpleTestCase):
|
|||
mocked_thread.call_args[1],
|
||||
{'target': fake_main_func, 'args': (123,), 'kwargs': {'abc': 123}, 'name': 'django-main-thread'}
|
||||
)
|
||||
self.assertSequenceEqual(fake_thread.setDaemon.call_args[0], [True])
|
||||
self.assertIs(fake_thread.daemon, True)
|
||||
self.assertTrue(fake_thread.start.called)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue