Did you know that if i call sys.exit(0) inside a try block, the program will cause an exception? Do you consider this a bug?
Code:
"""
bla bla bla
"""
import sys
try:
print( "oi" )
sys.exit(0)
except:
print( "erro" )
print( sys.exc_info() )
sys.exit(1)
print( 'fim?' )
# vim: fileencoding=utf-8: expandtab: shiftwidth=4: tabstop=8: softtabstop=4
The output of this code is:
Code:
$ p3 min3.py
oi
erro
(<class 'SystemExit'>, SystemExit(0), <traceback object at 0x7f1160bdd700>)
$ # and exit code of was 1, not 0!