Skip to content

Commit

Permalink
Fix crash when attempting to report an error in the UI with details (#…
Browse files Browse the repository at this point in the history
…12554)

Ref #12354.

Assignment to `_` was almost certainly unintended in the line `_ = dialog.run()`, and has been removed.

As is, the code forced `_` to be recognized as a local (see https://stackoverflow.com/questions/370357); in the case where a non-`None` value is passed, this would mean that `_` is used before assignment.

Context implies that `_` is supposed to be a globally defined function, but further implies that the result from `dialog.run` *should not* replace that value.

Most likely, the original code was assigning to `_` for debugging purposes (i.e. so that the local value could be examined in a debugger), and the name collision was unintended.
  • Loading branch information
zahlman authored Dec 5, 2024
1 parent ab0b401 commit fedb183
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/usr/share/cinnamon/cinnamon-settings/bin/Spices.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ def _ui_error_message(self, msg, detail=None):
esc = html.escape(markup)
dialog.set_markup(esc)
dialog.show_all()
_ = dialog.run()
dialog.run()
dialog.destroy()

def errorMessage(self, msg, detail=None):
Expand Down

0 comments on commit fedb183

Please sign in to comment.