Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7b811f8

Browse files
committed
Improve the error message when initializing compiler failed.
1 parent 6bbab81 commit 7b811f8

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

numpy/distutils/command/config.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,16 @@ def _check_compiler (self):
6262
self.compiler.initialize()
6363
except IOError, e:
6464
msg = """\
65-
Could not initialize %s instance: do you have Visual Studio installed ? If you
66-
are trying to build with mingw, please use python setup.py build -c mingw32
67-
instead (original caught exception was %s). If you have Visual Studio
68-
installed, check it is correctly installed, and the right version (VS 2008 for
69-
python 2.6, VS 2003 for 2.5, etc...)""" % \
70-
(self.compiler.__class__.__name__, e)
65+
Could not initialize compiler instance: do you have Visual Studio
66+
installed ? If you are trying to build with mingw, please use python setup.py
67+
build -c mingw32 instead ). If you have Visual Studio installed, check it is
68+
correctly installed, and the right version (VS 2008 for python 2.6, VS 2003 for
69+
2.5, etc...). Original exception was: %s, and the Compiler
70+
class was %s
71+
============================================================================""" \
72+
% (e, self.compiler.__class__.__name__)
73+
print """\
74+
============================================================================"""
7175
raise distutils.errors.DistutilsPlatformError(msg)
7276

7377
def _wrap_method(self,mth,lang,args):

0 commit comments

Comments
 (0)