Message862
Given the following code:
# test_exit.py
import sys
def exitfunc():
print 'exiting'
sys.exitfunc = exitfunc
try:
sys.exit('goodbye')
finally:
print 'finally'
If executed by the jython interpreter, the script
produces the following output:
$ jython test_exit.py
finally
exiting
goodbye
The host OS correctly reports an exit status of 1 for the
JVM.
However, if frozen by jythonc, the script produces the
following output when run:
$ jythonc --core --jar test_exit.jar test_exit.py
$ java -jar test_exit.jar
finally
exiting
In this case, the host OS incorrectly reports an exit
status of 0 for the JVM. Also, the string object passed
to sys.exit is never printed by the Jython runtime.
The results are similar if the sys.exit argument is a non-
zero integer instead of a string. The argument is
ignored by the Jython runtime for a frozen application,
and the JVM exits with a status code of 0.
Regards,
Stephen |
|
Date |
User |
Action |
Args |
2008-02-20 17:17:15 | admin | link | issue783042 messages |
2008-02-20 17:17:15 | admin | create | |
|