Remove a context manager to improve compatibility with older versions of scipy.