hplip/hplip-dialog-infinite-loop.patch
Petr Šabata 3b7ae335f3 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/hplip#7cb6f648cdb35a0f018b511d10b516d6d9e4d638
2020-10-15 12:26:13 +02:00

35 lines
1016 B
Diff

diff --git a/ui5/devmgr5.py b/ui5/devmgr5.py
index c23957a..48b248f 100644
--- a/ui5/devmgr5.py
+++ b/ui5/devmgr5.py
@@ -2247,7 +2247,7 @@ class PasswordDialog(QDialog):
self.prompt = prompt
Layout= QGridLayout(self)
- Layout.setMargin(11)
+ Layout.setContentsMargins(11, 11, 11, 11)
Layout.setSpacing(6)
self.PromptTextLabel = QLabel(self)
@@ -2300,14 +2300,15 @@ class PasswordDialog(QDialog):
# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
def showPasswordUI(prompt):
+ dlg = None
+
try:
dlg = PasswordDialog(prompt, None)
+ except Exception as e:
+ log.error('Unable to open password dialog due following error:\n {}'.format(e))
- if dlg.exec_() == QDialog.Accepted:
- return (dlg.getUsername(), dlg.getPassword())
-
- finally:
- pass
+ if dlg and dlg.exec_() == QDialog.Accepted:
+ return (dlg.getUsername(), dlg.getPassword())
return ("", "")