try finally doesn't

Colin Brown cbrown at metservice.com
Wed Nov 26 15:35:32 EST 2003


When I run this code and then immediately do a Control-C, I do not get the
'thread' printed?

Colin Brown
PyNZ
-----------------------------------------------------------
import thread, time

def x():
    try:
        time.sleep(60)
    finally:
        print 'thread'

thread.start_new_thread(x,())
time.sleep(60)








More information about the Python-list mailing list