Permalink
Browse files

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/.
  • Loading branch information...
1 parent f98ffb5 commit cd6d53ffc62562e3627b991a376512a4c1b78e1a @rgommers rgommers committed Apr 17, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 setup.py
View
@@ -114,7 +114,12 @@ def write_version_py(filename='numpy/version.py'):
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"

0 comments on commit cd6d53f

Please sign in to comment.