From 9d6a6e5927ae0e67164383e419f3145fc154467e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 4 Jan 2015 11:35:16 -0500 Subject: Use except/as, now supported by Python 2.6 --- setuptools/msvc9_support.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'setuptools/msvc9_support.py') diff --git a/setuptools/msvc9_support.py b/setuptools/msvc9_support.py index d0be70e2..e76d70f0 100644 --- a/setuptools/msvc9_support.py +++ b/setuptools/msvc9_support.py @@ -50,8 +50,7 @@ def find_vcvarsall(version): def query_vcvarsall(version, *args, **kwargs): try: return unpatched['query_vcvarsall'](version, *args, **kwargs) - except distutils.errors.DistutilsPlatformError: - exc = sys.exc_info()[1] + except distutils.errors.DistutilsPlatformError as exc: if exc and "vcvarsall.bat" in exc.args[0]: message = 'Microsoft Visual C++ %0.1f is required (%s).' % (version, exc.args[0]) if int(version) == 9: -- cgit v1.2.1 From 07dac60e9e33d9d74232eab325a3a8ad6a05e50d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 15 Jan 2015 19:57:21 -0500 Subject: Remove unused import --- setuptools/msvc9_support.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'setuptools/msvc9_support.py') diff --git a/setuptools/msvc9_support.py b/setuptools/msvc9_support.py index e76d70f0..2e4032b1 100644 --- a/setuptools/msvc9_support.py +++ b/setuptools/msvc9_support.py @@ -1,5 +1,3 @@ -import sys - try: import distutils.msvc9compiler except ImportError: -- cgit v1.2.1 From 64f09ab5fb6c9c0a0344e50388022ee6e2e85d85 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 15 Jan 2015 20:28:02 -0500 Subject: Extract variables --- setuptools/msvc9_support.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'setuptools/msvc9_support.py') diff --git a/setuptools/msvc9_support.py b/setuptools/msvc9_support.py index 2e4032b1..a69c7474 100644 --- a/setuptools/msvc9_support.py +++ b/setuptools/msvc9_support.py @@ -27,13 +27,15 @@ def patch_for_specialized_compiler(): def find_vcvarsall(version): Reg = distutils.msvc9compiler.Reg VC_BASE = r'Software\%sMicrosoft\DevDiv\VCForPython\%0.1f' + key = VC_BASE % ('', version) try: # Per-user installs register the compiler path here - productdir = Reg.get_value(VC_BASE % ('', version), "installdir") + productdir = Reg.get_value(key, "installdir") except KeyError: try: # All-user installs on a 64-bit system register here - productdir = Reg.get_value(VC_BASE % ('Wow6432Node\\', version), "installdir") + key = VC_BASE % ('Wow6432Node\\', version) + productdir = Reg.get_value(key, "installdir") except KeyError: productdir = None -- cgit v1.2.1