summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-06-11 09:25:41 +0000
committerTarek Ziadé <ziade.tarek@gmail.com>2009-06-11 09:25:41 +0000
commitff5433602ae6fba401eb8d4bcbf2101710e02aac (patch)
tree47f611f78ca1be1bd5a2bdc864a099f91278b33d
parenta8b5a14fe2e60d9ef0a72d7b64aa1fefb6389134 (diff)
downloadcpython-git-ff5433602ae6fba401eb8d4bcbf2101710e02aac.tar.gz
Merged revisions 73348 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r73348 | tarek.ziade | 2009-06-11 11:13:36 +0200 (Thu, 11 Jun 2009) | 1 line #6263 fixed syntax error in distutils.cygwinccompiler ........
-rw-r--r--Lib/distutils/cygwinccompiler.py2
-rw-r--r--Lib/distutils/tests/test_cygwinccompiler.py35
-rw-r--r--Misc/NEWS2
3 files changed, 37 insertions, 2 deletions
diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py
index f541489190..a552ffd934 100644
--- a/Lib/distutils/cygwinccompiler.py
+++ b/Lib/distutils/cygwinccompiler.py
@@ -81,7 +81,7 @@ def get_msvcr():
# 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):
diff --git a/Lib/distutils/tests/test_cygwinccompiler.py b/Lib/distutils/tests/test_cygwinccompiler.py
index 42c5ea40a6..c5a6495da5 100644
--- a/Lib/distutils/tests/test_cygwinccompiler.py
+++ b/Lib/distutils/tests/test_cygwinccompiler.py
@@ -8,7 +8,8 @@ import subprocess
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 @@ class CygwinCCompilerTestCase(support.TempdirManager,
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)
diff --git a/Misc/NEWS b/Misc/NEWS
index 46ab90e3f8..a7a0e5c9d4 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -772,6 +772,8 @@ Core and Builtins
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.