[Twisted-Python] Urgent - reactor is not working out of a sudden

Itamar Turner-Trauring itamar at itamarst.org
Sat May 2 10:31:33 MDT 2015


On 05/02/2015 11:54 AM, Jessica Tsui wrote:
>
> I was working on my program and everything was fine, out of the blue 
> the python editor just told me that connectTCP and listenTCP cannot be 
> referenced in reactor.py. I tried to reinstall twisted but that didn't 
> help at all. How could I solve this?
>
>
reactor.py doesn't have those, yes - that's expected. Twisted does this 
terrible thing where it replaces "twisted.internet.reactor", which 
starts out as reactor.py, with a new object at import time. So your code 
should work even though the file itself is missing those functions. This 
is where it does that:

https://github.com/twisted/twisted/blob/trunk/twisted/internet/reactor.py#L36




More information about the Twisted-Python mailing list