Skip to content

Commit

Permalink
Revise comment about random but regular test suite crashes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ntoll committed Feb 13, 2020
1 parent c292244 commit c30aa54
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions securedrop_client/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1990,10 +1990,14 @@ def eventFilter(self, obj, event):
if t == QEvent.MouseButtonPress:
if event.button() == Qt.LeftButton:
self._on_left_click()
# HERE BE DRAGONS. Usually I'd wrap this in an if not self.download,
# but for reasons not entirely clear, this caused a crash. The
# following odd way of expressing the same conditional doesn't cause a
# crash. Go figure... :-/
# HERE BE DRAGONS.
# The checks for "not self.downloading" in the following lines of code
# probably look strange. The obvious thing to do is to wrap such a
# check as a conditional. However, for reasons that are not entirely
# clear, this regularly caused random crashes when running the test
# suite (on Ubuntu 18.04, Python3.7). The following code expresses the
# same logic but without causing the random the crash of the test
# suite.
if (t == QEvent.HoverEnter or t == QEvent.HoverMove) and not self.downloading:
self.download_button.setIcon(load_icon('download_file_hover.svg'))
elif t == QEvent.HoverLeave and not self.downloading:
Expand Down

0 comments on commit c30aa54

Please sign in to comment.