SVN: r23734 - trunk/quixote/form2

Neil Schemenauer <nascheme-fVcApmY9cLvQ3/1i3zOLAti2O/[email protected]> Thu, 18 Mar 2004 12:17:48 -0500
Newsgroups gmane.comp.web.quixote.cvs
Message-ID <[email protected]>
Author: nascheme
Date: 2004-03-18 12:17:48 -0500 (Thu, 18 Mar 2004)
New Revision: 23734

Modified:
   trunk/quixote/form2/widget.py
Log:
Require a list of options for select widgets.


Modified: trunk/quixote/form2/widget.py
===================================================================
--- trunk/quixote/form2/widget.py	2004-03-18 17:09:46 UTC (rev 23733)
+++ trunk/quixote/form2/widget.py	2004-03-18 17:17:48 UTC (rev 23734)
@@ -262,8 +262,9 @@
         assert self.__class__ is not SelectWidget, "abstract class"
         Widget.__init__(self, name, value, **kwargs)
         self.options = []
-        if options is not None:
-            assert options, 'cannot pass empty options list'
+        if not options:
+            raise ValueError, "a non-empty list of 'options' is required"
+        else:
             self.set_options(options, sort)
         self.verify_selection = verify_selection