← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #695712]: IDE: exit in try: block throws Exception

 

Question #695712 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/695712

Summary changed to:
IDE: exit in try: block throws Exception 

Description changed to:
workaround see comment #1
-------------------------------------------------
*****
updated my comments for workaround


Hi
i wish to gracefully end my application. however when it use exit or exit(2) i always get an SystemExit  exception
is there a way i can avoid systemexit exception?
build 2.0.4
 below is sample code
try:
    print("help")
    exit()

except:
    print("in except:")

 output
help
in except:


if i add traceback then below is detailed output
help
in except:
sky>in error
Traceback (most recent call last):
  File "C:\Perf\Work\Groups\AntiPirates\PDFNext\Automations\FeatTests\Common\UIAutomation\acrobat.sikuli\test1.sikuli\test1.py", line 4, in <module>
    exit()
  File "C:\Users\cshamdas\AppData\Roaming\Sikulix\Lib\sikuli\Sikuli.py", line 569, in exit
    sys.exit(code)
SystemExit: 0

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.