From e4b46cd4dcdb0413f41b613addec75210f3084cc Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Tue, 1 Jan 2019 14:43:53 +0200 Subject: [PATCH] BENCH: don't fail at import time with old Numpy --- benchmarks/benchmarks/bench_overrides.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/benchmarks/benchmarks/bench_overrides.py b/benchmarks/benchmarks/bench_overrides.py index b42c5d185bf9..58572d07d050 100644 --- a/benchmarks/benchmarks/bench_overrides.py +++ b/benchmarks/benchmarks/bench_overrides.py @@ -2,7 +2,15 @@ from .common import Benchmark -from numpy.core.overrides import array_function_dispatch +try: + from numpy.core.overrides import array_function_dispatch +except ImportError: + # Don't fail at import time with old Numpy versions + def array_function_dispatch(*args, **kwargs): + def wrap(*args, **kwargs): + return None + return wrap + import numpy as np