Threading change, 2.5.4 -> 2.6.1

Hans Mulder hansmu at xs4all.nl
Fri Jan 8 22:13:50 CET 2010


anon wrote:
> Gib Bogle wrote:
>> The code below runs with Python 2.5.4, but gives the following error 
>> messages with Python 2.6.1.  What needs to be done to make it work?  
>> Thanks.
>>
>> C:\Summer09\Tutorials>python url_queue.pyw
>> Traceback (most recent call last):
>> File "url_queue.pyw", line 3, in <module>
>> import threading
>> File "C:\Summer09\Tutorials\threading.py", line 9, in <module>
>> class ProcessingThread(threading.Thread, QtCore.QObject):
>> AttributeError: 'module' object has no attribute 'Thread'
>>
> 
> Nothing to do with the version of python
> 
> You have a file called threading.py in C:\Summer09\Tutorials (the same 
> folder as url_queue.pyw). The line 'import threading' is finding this 
> module before python's threading module.
> 
> Rename this file and you should be fine.

Keep in mind that if there's a threading.pyc in C:\Summer09\Tutorials,
you have to rename (or delete) that one as well.

Hope this helps,

-- HansM






More information about the Python-list mailing list