Issue1405
Created on 2009-07-17.20:37:16 by whistler11783, last changed 2009-08-07.14:48:30 by fwierzbicki.
msg4916 (view) |
Author: Robert Scrimo (whistler11783) |
Date: 2009-07-17.20:37:15 |
|
__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
|
msg5002 (view) |
Author: Leonardo Soto (leosoto) |
Date: 2009-08-06.20:18:25 |
|
Fixed on r6634.
Frank: Any idea on how to add a test for this bug?
|
msg5006 (view) |
Author: Frank Wierzbicki (fwierzbicki) |
Date: 2009-08-07.14:48:30 |
|
Leo: the best support for this sort of unix-specific shell test that I
know of would be to add to the script tests/shell/test-jython.sh. Looks
like Nicholas Riley wrote it. It is exercised by the ant task
"launchertest"
|
|
Date |
User |
Action |
Args |
2009-08-07 14:48:30 | fwierzbicki | set | messages:
+ msg5006 |
2009-08-06 20:18:26 | leosoto | set | status: open -> closed resolution: fixed messages:
+ msg5002 nosy:
+ leosoto |
2009-07-19 15:13:23 | fwierzbicki | set | nosy:
+ fwierzbicki |
2009-07-17 20:37:16 | whistler11783 | create | |
|