summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@googlemail.com>2011-04-17 16:04:11 +0200
committerRalf Gommers <ralf.gommers@googlemail.com>2011-04-20 22:19:55 +0200
commitcd6d53ffc62562e3627b991a376512a4c1b78e1a (patch)
tree3d5a08451d234bda6802b21d7fd5609783a2cbdb /setup.py
parentf98ffb560c54a804036dbdb04d21090c22853dc1 (diff)
downloadnumpy-cd6d53ffc62562e3627b991a376512a4c1b78e1a.tar.gz
BLD: raise a clearer warning in case of building without cleaning up first.
Occurs only on Python 3.x when a version.py file is already present, due to copying the whole tree into build/pyk3/.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 4f35d9c6c..542ca7bfb 100755
--- a/setup.py
+++ b/setup.py
@@ -114,7 +114,12 @@ if not release:
GIT_REVISION = git_version()
elif os.path.exists('numpy/version.py'):
# must be a source distribution, use existing version file
- from numpy.version import git_revision as GIT_REVISION
+ try:
+ from numpy.version import git_revision as GIT_REVISION
+ except ImportError:
+ raise ImportError("Unable to import git_revision. Try removing " \
+ "numpy/version.py and the build directory " \
+ "before building.")
else:
GIT_REVISION = "Unknown"