I would write

if  isinstance(value, basestring) and not value.strip():
    return