From: Fredrik Lundh Date: Wed, 24 Nov 2004 22:31:11 +0000 (+0000) Subject: SF patch #1071739 (by Christos Georgiou) X-Git-Tag: v2.4~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cb328f393e9ca0278491a97fad48c225ad9c5484;p=thirdparty%2FPython%2Fcpython.git SF patch #1071739 (by Christos Georgiou) This patch offers a better explanation in case the MS VC++ (free) toolkit is installed but the .NET Framework SDK is not. --- diff --git a/Lib/distutils/msvccompiler.py b/Lib/distutils/msvccompiler.py index dd9d8928ad70..ccb62a8813f3 100644 --- a/Lib/distutils/msvccompiler.py +++ b/Lib/distutils/msvccompiler.py @@ -124,10 +124,15 @@ class MacroExpander: self.set_macro("VSInstallDir", vsbase + r"\Setup\VS", "productdir") net = r"Software\Microsoft\.NETFramework" self.set_macro("FrameworkDir", net, "installroot") - if version > 7.0: - self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1") - else: - self.set_macro("FrameworkSDKDir", net, "sdkinstallroot") + try: + if version > 7.0: + self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1") + else: + self.set_macro("FrameworkSDKDir", net, "sdkinstallroot") + except KeyError, exc: # + raise DistutilsPlatformError, \ + ("The .NET Framework SDK needs to be installed before " + "building extensions for Python.") p = r"Software\Microsoft\NET Framework Setup\Product" for base in HKEYS: