From 5175136419876d0fb1269bc81a5d3aabed785f4a Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 11 Jan 2021 15:49:08 +0000 Subject: [PATCH] plug.py: Avoid Tk event_generate() call from show_error() if in shutdown --- plug.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plug.py b/plug.py index 07d43dfb..98591a84 100644 --- a/plug.py +++ b/plug.py @@ -366,9 +366,16 @@ def notify_newdata(data, is_beta): def show_error(err): """ Display an error message in the status line of the main window. + + Will be NOP during shutdown to avoid Tk hang. :param err: .. versionadded:: 2.3.7 """ + + if config.shutting_down(): + logger.info(f'Called during shutdown: "{str(err)}"') + return + if err and last_error['root']: last_error['msg'] = str(err) last_error['root'].event_generate('<>', when="tail")