-
-
Notifications
You must be signed in to change notification settings - Fork 703
Closed
Description
If I call sys.exit() from a Sage script, the script exits but not with the correct exit code. For example, the script
import sys
print 'exiting!'
sys.exit(1)
exits with exit code 0 when run from Sage:
$ sage exitcode.sage
exiting!
1
$ echo $?
0
(the 1 gets printed because the preparser turns it into a Sage integer, and Python prints out anything except Python integers.) But the same script works properly when run from Python:
$ python exitcode.sage
exiting!
$ echo $?
1
I don't know if this is Sage or IPython behavior, but having this work would be really useful.
Component: user interface
Issue created by migration from https://trac.sagemath.org/ticket/2861