Skip to content

Commit

Permalink
Return false if PyQt5 is not available on user confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
xoriole committed Dec 17, 2020
1 parent 8ea204b commit f068b0f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,11 @@ def get_confirmation(exception):
"""
# Prevent importing PyQt globally in tribler-common module.
# pylint: disable=import-outside-toplevel
from PyQt5.QtWidgets import QApplication, QMessageBox
try:
from PyQt5.QtWidgets import QApplication, QMessageBox
except ImportError:
SentryReporter._logger.debug("PyQt5 is not available. User confirmation is not possible.")
return False

SentryReporter._logger.debug(f"Get confirmation: {exception}")

Expand Down

0 comments on commit f068b0f

Please sign in to comment.