summaryrefslogtreecommitdiff
path: root/numpy/distutils
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2016-01-16 09:38:57 -0700
committerCharles Harris <charlesr.harris@gmail.com>2016-01-16 09:38:57 -0700
commitcc2a6952be7c7a9c5749eac01cfb3289b305308b (patch)
tree7d8d820cbaaebd58c60ca8afe51399fc8b3eaa44 /numpy/distutils
parent0f72920972dd2935991f839b0872d8fcca65c079 (diff)
parentb27e9b12c9d94492a273162704ace3a23351db25 (diff)
downloadnumpy-cc2a6952be7c7a9c5749eac01cfb3289b305308b.tar.gz
Merge pull request #7029 from rgommers/fix-interrupted-rebuild
BLD: fix rebuilding after a failed build. Closes gh-5467.
Diffstat (limited to 'numpy/distutils')
-rw-r--r--numpy/distutils/__init__.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/numpy/distutils/__init__.py b/numpy/distutils/__init__.py
index 766439d92..602a3d117 100644
--- a/numpy/distutils/__init__.py
+++ b/numpy/distutils/__init__.py
@@ -11,13 +11,13 @@ from . import unixccompiler
from .info import __doc__
from .npy_pkg_config import *
+# If numpy is installed, add distutils.test()
try:
from . import __config__
- _INSTALLED = True
-except ImportError:
- _INSTALLED = False
-
-if _INSTALLED:
+ # Normally numpy is installed if the above import works, but an interrupted
+ # in-place build could also have left a __config__.py. In that case the
+ # next import may still fail, so keep it inside the try block.
from numpy.testing.nosetester import _numpy_tester
test = _numpy_tester().test
- bench = _numpy_tester().bench
+except ImportError:
+ pass