daemon thread doesn't stop in python
<p>Why doesn't the main thread kill the daemon one?</p>

<pre><code>import threading
import time

print_lock = threading.Lock()

def exampleNoneDaemon():
    for x in range(3):
        with print_lock:
            print(x, "master")
        time.sleep(0.7)

t1 = threading.Thread(target=exampleNoneDaemon)
t1.start()

def exampleDaemon():
    while True:
        with print_lock:
            print("daemon")
        time.sleep(1)

t2 = threading.Thread(target=exampleDaemon)
t2.daemon = True
t2.start()
</code></pre>

<p>the output of this code is:</p>

<pre><code>0 master
daemon
1 master
daemon
2 master
daemon
daemon
daemon
daemon
...
</code></pre>

<p>What have I done wrong?</p>