summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-02-23 21:19:37 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-02-23 21:19:37 -0500
commitdd70b3b6f6c00d753d7ff80ed8cf74448606e266 (patch)
tree43c4658c403b256a342133087304a81a3e70c3db
parentb85f1ed5eaa2eca271b28a0aaddfebadfb8dedde (diff)
downloadpython-setuptools-git-dd70b3b6f6c00d753d7ff80ed8cf74448606e266.tar.gz
Extract function for _augment_exception.
-rw-r--r--setuptools/msvc9_support.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/setuptools/msvc9_support.py b/setuptools/msvc9_support.py
index c0587f31..e80fb859 100644
--- a/setuptools/msvc9_support.py
+++ b/setuptools/msvc9_support.py
@@ -54,8 +54,6 @@ def find_vcvarsall(version):
return unpatched['find_vcvarsall'](version)
def query_vcvarsall(version, arch='x86', *args, **kwargs):
- message = ''
-
# Try to get environement from vcvarsall.bat (Classical way)
try:
return unpatched['query_vcvarsall'](version, arch, *args, **kwargs)
@@ -70,10 +68,18 @@ def query_vcvarsall(version, arch='x86', *args, **kwargs):
try:
return _compute_env(version, arch)
except distutils.errors.DistutilsPlatformError as exc:
- # Error if MSVC++ directory not found or environment not set
- message = exc.args[0]
+ _augment_exception(exc, version)
+ raise
+
+
+def _augment_exception(exc, version):
+ """
+ Add details to the exception message to help guide the user
+ as to what action will resolve it.
+ """
+ # Error if MSVC++ directory not found or environment not set
+ message = exc.args[0]
- # Raise error
if message and "vcvarsall.bat" in message:
# Special error message if MSVC++ not installed
message = 'Microsoft Visual C++ %0.1f is required (%s).' %\
@@ -88,7 +94,7 @@ def query_vcvarsall(version, arch='x86', *args, **kwargs):
message += ' Get it with "Microsoft Windows SDK for Windows 7": '
message += r'www.microsoft.com/download/details.aspx?id=8279'
- raise distutils.errors.DistutilsPlatformError(message)
+ exc.args[0] = message
class PlatformInfo: