is it a bug?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sun Jan 27 15:37:39 EST 2008


En Sun, 27 Jan 2008 14:21:20 -0200, Mr Shore <shore.cloud at gmail.com>  
escribi�:

> import threading
> import time
> class timer(threading.Thread):
>     def __init__(self,no,interval):
>         threading.Thread.__init__(self)
>         self.no=no
>         self.interval=interval
>
>     def run(self):
>         while True:
>             print 'Thread Object (%d), Time:%s'%(self.no,time.ctime())
>             time.sleep(self.interval)
>
> def test():
>     threadone=timer(1,1)
>     threadtwo=timer(2,3)
>     threadone.start()
>     threadtwo.start()
>     print 'main thread'
>
> if __name__=='__main__':
>     test()
> when I run the above programme,an error comes out but ignored
> Exception exceptions.AttributeError: '_shutdown' in <module 'threading'  
> from
> 'F:
> \Python25\lib\threading.pyc'> ignored

That looks like an error when Python is shutting down itself. As your  
program never ends, how did you stop it?

-- 
Gabriel Genellina




More information about the Python-list mailing list