Skip to content

Commit

Permalink
BLD: raise a clearer warning in case of building without cleaning up …
Browse files Browse the repository at this point in the history
…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
rgommers committed Apr 20, 2011
1 parent f98ffb5 commit cd6d53f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion setup.py
Expand Up @@ -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"

Expand Down

0 comments on commit cd6d53f

Please sign in to comment.