mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Issue #6064: Add a daemon
keyword argument to the threading.Thread
and multiprocessing.Process constructors in order to override the default behaviour of inheriting the daemonic property from the current thread/process.
This commit is contained in:
parent
4bc685752f
commit
0bd4deba38
7 changed files with 59 additions and 21 deletions
|
@ -427,6 +427,14 @@ class ThreadTests(BaseTestCase):
|
|||
t.daemon = True
|
||||
self.assertTrue('daemon' in repr(t))
|
||||
|
||||
def test_deamon_param(self):
|
||||
t = threading.Thread()
|
||||
self.assertFalse(t.daemon)
|
||||
t = threading.Thread(daemon=False)
|
||||
self.assertFalse(t.daemon)
|
||||
t = threading.Thread(daemon=True)
|
||||
self.assertTrue(t.daemon)
|
||||
|
||||
|
||||
class ThreadJoinOnShutdown(BaseTestCase):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue