Message862

Author stepturn
Recipients
Date 2003-08-04.19:53:54
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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
History
Date User Action Args
2008-02-20 17:17:15adminlinkissue783042 messages
2008-02-20 17:17:15admincreate