[Twisted-Python] win32eventreactor problems

Bob Ippolito bob at redivi.com
Wed Aug 13 13:38:51 MDT 2003


On Wednesday, Aug 13, 2003, at 15:21 America/New_York, Justin Johnson 
wrote:

> I had the win32eventreactor working a while back, but now I have a
> problem and I'm not sure what's going on.  The attached file installs
> win32eventreactor as follows:
>
> ---
> if not config.isUnix:
> 	from twisted.internet import win32eventreactor
> 	win32eventreactor.install()
> ---
>
> When I run this I get the following error:
>
> ---
> Traceback (most recent call last):
>   File "E:\ccase\python\uhg\uht\process.py", line 13, in ?
>     win32eventreactor.install()
>   File
>   
> "E:\Python22\Lib\site-packages\twisted\internet\win32eventreactor.py",
>   li
> ne 228, in install
>     main.installReactor(r)
>   File "E:\Python22\Lib\site-packages\twisted\internet\main.py", line 
> 90,
>   in ins
> tallReactor
>     assert not sys.modules.has_key('twisted.internet.reactor'), \
> AssertionError: reactor already installed

You need to win32eventreactor.install() before you import reactor from 
anywhere.. so this typically means that it needs to be at or near the 
top of your __main__ script, and you should do this before you even 
import other modules from Twisted.

-bob





More information about the Twisted-Python mailing list