[Python-checkins] r73348 - in python/trunk: Lib/distutils/cygwinccompiler.py Lib/distutils/tests/test_cygwinccompiler.py Misc/NEWS

tarek.ziade python-checkins at python.org
Thu Jun 11 11:13:37 CEST 2009


Author: tarek.ziade
Date: Thu Jun 11 11:13:36 2009
New Revision: 73348

Log:
#6263 fixed syntax error in distutils.cygwinccompiler

Modified:
   python/trunk/Lib/distutils/cygwinccompiler.py
   python/trunk/Lib/distutils/tests/test_cygwinccompiler.py
   python/trunk/Misc/NEWS

Modified: python/trunk/Lib/distutils/cygwinccompiler.py
==============================================================================
--- python/trunk/Lib/distutils/cygwinccompiler.py	(original)
+++ python/trunk/Lib/distutils/cygwinccompiler.py	Thu Jun 11 11:13:36 2009
@@ -81,7 +81,7 @@
             # VS2008 / MSVC 9.0
             return ['msvcr90']
         else:
-            raise ValueError("Unknown MS Compiler version %i " % msc_Ver)
+            raise ValueError("Unknown MS Compiler version %s " % msc_ver)
 
 
 class CygwinCCompiler (UnixCCompiler):

Modified: python/trunk/Lib/distutils/tests/test_cygwinccompiler.py
==============================================================================
--- python/trunk/Lib/distutils/tests/test_cygwinccompiler.py	(original)
+++ python/trunk/Lib/distutils/tests/test_cygwinccompiler.py	Thu Jun 11 11:13:36 2009
@@ -8,7 +8,8 @@
 from distutils import cygwinccompiler
 from distutils.cygwinccompiler import (CygwinCCompiler, check_config_h,
                                        CONFIG_H_OK, CONFIG_H_NOTOK,
-                                       CONFIG_H_UNCERTAIN, get_versions)
+                                       CONFIG_H_UNCERTAIN, get_versions,
+                                       get_msvcr)
 from distutils.tests import support
 
 class FakePopen(object):
@@ -113,6 +114,38 @@
         res = get_versions()
         self.assertEquals(res[2], None)
 
+    def test_get_msvcr(self):
+
+        # none
+        sys.version  = ('2.6.1 (r261:67515, Dec  6 2008, 16:42:21) '
+                        '\n[GCC 4.0.1 (Apple Computer, Inc. build 5370)]')
+        self.assertEquals(get_msvcr(), None)
+
+        # MSVC 7.0
+        sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
+                       '[MSC v.1300 32 bits (Intel)]')
+        self.assertEquals(get_msvcr(), ['msvcr70'])
+
+        # MSVC 7.1
+        sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
+                       '[MSC v.1310 32 bits (Intel)]')
+        self.assertEquals(get_msvcr(), ['msvcr71'])
+
+        # VS2005 / MSVC 8.0
+        sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
+                       '[MSC v.1400 32 bits (Intel)]')
+        self.assertEquals(get_msvcr(), ['msvcr80'])
+
+        # VS2008 / MSVC 9.0
+        sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
+                       '[MSC v.1500 32 bits (Intel)]')
+        self.assertEquals(get_msvcr(), ['msvcr90'])
+
+        # unknown
+        sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
+                       '[MSC v.1999 32 bits (Intel)]')
+        self.assertRaises(ValueError, get_msvcr)
+
 def test_suite():
     return unittest.makeSuite(CygwinCCompilerTestCase)
 

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Thu Jun 11 11:13:36 2009
@@ -317,6 +317,8 @@
 Library
 -------
 
+- Issue #6263: Fixed syntax error in distutils.cygwincompiler.
+
 - Issue #5201: distutils.sysconfig.parse_makefile() now understands `$$`
   in Makefiles. This prevents compile errors when using syntax like:
   `LDFLAGS='-rpath=\$$LIB:/some/other/path'`. Patch by Floris Bruynooghe.


More information about the Python-checkins mailing list