eric6/E5Gui/E5MessageBox.py

changeset 7628
f904d0eef264
parent 7360
9190402e4505
child 7759
51aa6c6b66f7
diff -r 7f643d41464e -r f904d0eef264 eric6/E5Gui/E5MessageBox.py
--- a/eric6/E5Gui/E5MessageBox.py	Wed Jun 17 17:12:21 2020 +0200
+++ b/eric6/E5Gui/E5MessageBox.py	Wed Jun 17 20:18:54 2020 +0200
@@ -235,8 +235,10 @@
         default button (boolean)
     @param textFormat format of the text (Qt.TextFormat)
     @return flag indicating the selection of the Yes button (boolean)
+    @exception ValueError raised to indicate a bad parameter value
     """
-    assert icon in [Critical, Information, Question, Warning]
+    if icon not in [Critical, Information, Question, Warning]:
+        raise ValueError("Bad value for 'icon' parameter.")
     
     res = __messageBox(
         parent, title, text, icon,
@@ -257,8 +259,10 @@
         Warning)
     @param textFormat format of the text (Qt.TextFormat)
     @return flag indicating the selection of the Retry button (boolean)
+    @exception ValueError raised to indicate a bad parameter value
     """
-    assert icon in [Critical, Information, Question, Warning]
+    if icon not in [Critical, Information, Question, Warning]:
+        raise ValueError("Bad value for 'icon' parameter.")
     
     res = __messageBox(
         parent, title, text, icon,

eric ide

mercurial