Kaydet (Commit) 4ff91eb5 authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Issue #22384: An exception in Tkinter callback no longer crashes the program

when it is run with pythonw.exe.

Documented that Tk.report_callback_exception() is purposed to be overriden in
applications.
......@@ -1919,9 +1919,12 @@ class Tk(Misc, Wm):
if os.path.isfile(base_py):
exec(open(base_py).read(), dir)
def report_callback_exception(self, exc, val, tb):
"""Internal function. It reports exception on sys.stderr."""
"""Report callback exception on sys.stderr.
Applications may want to override this internal function, and
should when sys.stderr is None."""
import traceback
sys.stderr.write("Exception in Tkinter callback\n")
print("Exception in Tkinter callback", file=sys.stderr)
sys.last_type = exc
sys.last_value = val
sys.last_traceback = tb
......
......@@ -132,6 +132,9 @@ Core and Builtins
Library
-------
- Issue #22384: An exception in Tkinter callback no longer crashes the program
when it is run with pythonw.exe.
- Issue #22168: Prevent turtle AttributeError with non-default Canvas on OS X.
- Issue #21147: sqlite3 now raises an exception if the request contains a null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment