backwards compatibility for older scipy versions