Message4916

Author whistler11783
Recipients whistler11783
Date 2009-07-17.20:37:15
SpamBayes Score 2.3629598e-11
Marked as misclassified No
Message-id <1247863036.95.0.103115951394.issue1405@psf.upfronthosting.co.za>
In-reply-to
Content
__run__.py script at root level of myscript.jar(copy of jython.jar):

-- __run__.py --
import sys
sys.exit(0)
-- __run__.py --

# java org.python.util.jython -jar myscript.jar
Upon executing the sys.exit(0) call(last line in script) in my main I
recieve the following exception:
Exception in thread "main" Traceback (most recent call last):
File "__run__", line 2, in
SystemExit: 0  
# echo $?
1

The script exit code is set to a 1 because an SystemExit exception is
thrown which is expected at exit if it is unhandled but I am calling
sys.exit(0) to set the exit code to 0 and in the main(top level) it
should not be throwing or at least propagating the exception upon
termination.

This behaviour does not occur when executing this same script outside of
the .jar(not as __run__.py)

# /jython2.5.0/jython myscript.py
# echo $?
0

This is the correct behavior
History
Date User Action Args
2009-07-17 20:37:17whistler11783setrecipients: + whistler11783
2009-07-17 20:37:16whistler11783setmessageid: <1247863036.95.0.103115951394.issue1405@psf.upfronthosting.co.za>
2009-07-17 20:37:16whistler11783linkissue1405 messages
2009-07-17 20:37:16whistler11783create