Commits

Fredrik Lundh  committed 7f95fe9

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.

  • Participants
  • Parent commits c1483f0
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Lib/distutils/msvccompiler.py

         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: