Revision: 8335
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8335&view=rev
Author:   efiring
Date:     2010-05-24 20:06:20 +0000 (Mon, 24 May 2010)

Log Message:
-----------
collections: fix bug in handling of antialiased kwarg

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/collections.py

Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py      2010-05-24 13:27:58 UTC 
(rev 8334)
+++ trunk/matplotlib/lib/matplotlib/collections.py      2010-05-24 20:06:20 UTC 
(rev 8335)
@@ -109,29 +109,31 @@
         self.update(kwargs)
         self._paths = None
 
-
-    def _get_value(self, val):
-        try: return (float(val), )
+    @staticmethod
+    def _get_value(val):
+        try:
+            return (float(val), )
         except TypeError:
             if cbook.iterable(val) and len(val):
-                try: float(val[0])
-                except TypeError: pass # raise below
-                except ValueError: pass
-                else: return val
+                try:
+                    float(val[0])
+                except (TypeError, ValueError):
+                    pass # raise below
+                else:
+                    return val
 
         raise TypeError('val must be a float or nonzero sequence of floats')
 
-    def _get_bool(self, val):
-        try: return (bool(val), )
-        except TypeError:
-            if cbook.iterable(val) and len(val):
-                try: bool(val[0])
-                except TypeError: pass # raise below
-                else: return val
+    @staticmethod
+    def _get_bool(val):
+        if not cbook.iterable(val):
+            val = (val,)
+        try:
+            bool(val[0])
+        except (TypeError, IndexError):
+            raise TypeError('val must be a bool or nonzero sequence of them')
+        return val
 
-        raise TypeError('val must be a bool or nonzero sequence of them')
-
-
     def get_paths(self):
         return self._paths
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------

_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to