[Twisted-Python] question about twisted conch (SSH) and wxPython

Andrew Bennetts andrew-twisted at puzzling.org
Mon Jul 18 03:22:11 EDT 2005


On Mon, Jul 18, 2005 at 05:02:52PM +1000, Astan Chee wrote:
> Whoops,
> I forgot to add the wantReply=1 there...
> anyway, Another question I have is if the password is incorrect, quit 
> the python script...
> 
> currently the getPassword function looks like this
> RETRIES = 0
> def getPassword(self):
>        global RETRIES
>        if RETRIES  == 0:
>            RETRIES = 1
>            return defer.succeed(PASSWORD)
>        else:           
>            sys.exit(0)

Use reactor.stop() rather than sys.exit(0).

-Andrew.





More information about the Twisted-Python mailing list