ENH be backward compatible for old version of scipy