[issue25819] print "Hi" in python 3 exception handling doesn't work

Emanuel Barry report at bugs.python.org
Mon Dec 7 17:53:50 EST 2015


Emanuel Barry added the comment:

The reason you are experiencing this behviour is because of the way Python works. Python needs to compile your code before it can execute it. It parses the code, sees an invalid token ('print "Hi"'), fails to compile and throws an error. Your code never gets executed because Python is not able to compile it in the first place. Try adding a print call before the try-except block and you'll see it never gets executed either :)

----------
nosy: +ebarry
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25819>
_______________________________________


More information about the Python-bugs-list mailing list