From d3d1434c50b62ce73a492252335e1de3448b2f2a Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Sun, 17 Apr 2011 16:04:11 +0200 Subject: [PATCH] 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/. --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4f35d9c6ca80..e41f93323410 100755 --- a/setup.py +++ b/setup.py @@ -114,7 +114,11 @@ 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("An installation issue occurred. Did you clean " \ + "your repository before building?") else: GIT_REVISION = "Unknown"