New submission from Abraham Karplus:

When a callback function gets called from Tkinter and raises SystemExit (either 
directly or through sys.exit), a new SystemExit exception is raised with the 
original exception as its code field, such as
SystemExit(SystemExit(),)
This is due to a bug in Tkinter's CallWrapper, where it has
except SystemExit as msg:
    raise SystemExit(msg)
which since msg is a SystemExit instance, creates the nesting. This bug did not 
exist in Python 2 because there the code was
except SystemExit, msg:
    raise SystemExit, msg
and this raises msg, as it already is a SystemExit instance. I suspect the bug 
was introduced by using the 2to3 tool, as it will do the conversion. If so, 
this is a bug in 2to3, as the two snippets are not functionally identical.

----------
components: Tkinter
messages: 176698
nosy: Abraham Karplus
priority: normal
severity: normal
status: open
title: Tkinter nested SystemExit
type: behavior
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16583>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to