add a ` if x.strip()` here. That way you can do `field.clean(',1,2,3,')` too.