Browse Source

Avoid empty interpolation crash

pull/35/head
Florian Mounier 12 years ago
parent
commit
0ed3a1e76d
  1. 6
      pygal/interpolate.py

6
pygal/interpolate.py

@ -39,8 +39,10 @@ def interpolation(x, y, kind):
if len(y) < len(x):
x = x[:len(y)]
x, y = zip(*filter(lambda t: None not in t, zip(x, y)))
pack = zip(*filter(lambda t: None not in t, zip(x, y)))
if len(pack) == 0:
return ident
x, y = pack
if len(x) < 2:
return ident
if isinstance(kind, int):

Loading…
Cancel
Save