Fix gscan exception hook dialog closure incapacity #2579
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Whilst reviewing #2574 I noticed that when I obtained a exception traceback in
gscan
in a pop-up dialog window, the window would immediately re-open after being prompted to close via clicking of the 'OK' button or the 'Close Window' cross corner iron (ad infinitum with further attempts to close it).To recreate: open gscan so it provides any 'entry' traceback e.g. by providing invalid arguments to it such as
cylc gscan -o '*' -n '*'
or by editing the code inlib/cylc/gui/gscan.py
to create an error there.I have resolved this by changing an argument so that (as I understand the logic) the
set_exception_hook_dialog
function will only launch an exception dialog if it has not already been launched. The variableold_hook
was in fact already initialised within the function but not implemented in this way; it seems (?) the original writer intended to include it as an argument to_launch_exception_hook_dialog
function but mistakenly putsys.excepthook
instead.