BUG: TypeError: len() of unsized object

I encountered a type error for the following script:

from matplotlib import *
from pylab import *
colours = ['lemonchiffon', 'lightskyblue', 'indianred']
x = [170.804, 186.838, 217.725]
y = arange(3)+.5 # the bar centers on the y axis
barh(x,y, color=colours)
yticks(y, ('A', 'B', 'C'))
show()

  File "C:\Python24\Lib\site-packages\matplotlib\pylab.py", line 1661, in barh
    ret = gca().barh(*args, **kwargs)
  File "C:\Python24\lib\site-packages\matplotlib\axes.py", line 1238, in barh
    if (is_string_like(color) or
TypeError: len() of unsized object

I added "and iterable(left)" before checking for len(left) to line
1238 in axes.py to make the error go away:
        if (is_string_like(color) or
            (iterable(color) and len(color)==3 and iterable(left) and
len(left)!=3) or
            not iterable(color)):
            color = [color]*len(x)

Is there a better solution?