Message4916
__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 |
|
Date |
User |
Action |
Args |
2009-07-17 20:37:17 | whistler11783 | set | recipients:
+ whistler11783 |
2009-07-17 20:37:16 | whistler11783 | set | messageid: <1247863036.95.0.103115951394.issue1405@psf.upfronthosting.co.za> |
2009-07-17 20:37:16 | whistler11783 | link | issue1405 messages |
2009-07-17 20:37:16 | whistler11783 | create | |
|