← Back to team overview

sikuli-driver team mailing list archive

[Question #234705]: Why does exit() only work half of the time?

 

New question #234705 on Sikuli:
https://answers.launchpad.net/sikuli/+question/234705

I use exit() in a hotkey and it stops the Sikuli program half of the time. However, whenever I press the hotkey all the other code in it is always executed successfully. How can I fix this to make the Sikuli program stop every time I press the hotkey?

Here is the hotkey:

def stopSikuli(event):
    print("stopSikuli")
    logger.warning("stopSikuli executed")
    stopLogging(logger, hdlr, log_name)
    Env.removeHotkey("c", KeyModifier.CTRL)
    exit(1)

I initialize the hotkey later with:

Env.addHotkey("c", KeyModifier.CTRL, stopSikuli)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.