]> granicus.if.org Git - python/commitdiff
Merged revisions 74163 via svnmerge from
authorTarek Ziadé <ziade.tarek@gmail.com>
Wed, 22 Jul 2009 08:57:28 +0000 (08:57 +0000)
committerTarek Ziadé <ziade.tarek@gmail.com>
Wed, 22 Jul 2009 08:57:28 +0000 (08:57 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r74163 | tarek.ziade | 2009-07-22 10:55:19 +0200 (Wed, 22 Jul 2009) | 1 line

  Issue #6545: Removed assert statements in distutils.Extension, so the behavior is similar when used with -O
........

Lib/distutils/extension.py
Misc/NEWS

index 16d2bef6f44bcdf572bcfcae26d28d31cf437a4d..5c07bdae82415e4fb8155aa25a7904e3d841107a 100644 (file)
@@ -103,10 +103,11 @@ class Extension:
                   optional=None,
                   **kw                      # To catch unknown keywords
                  ):
-        assert isinstance(name, str), "'name' must be a string"
-        assert (isinstance(sources, list) and
-                all(isinstance(v, str) for v in sources)), \
-                "'sources' must be a list of strings"
+        if not isinstance(name, str):
+            raise AssertionError("'name' must be a string")
+        if not (isinstance(sources, list) and
+                all(isinstance(v, str) for v in sources)):
+            raise AssertionError("'sources' must be a list of strings")
 
         self.name = name
         self.sources = sources
index da7fa5bebe816c2a4ca973490c3e7fa729e07fc4..3f25faf4b9d8bb40871cfca5a75886bd9d4ecf42 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -940,6 +940,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #6545: Removed assert statements in distutils.Extension, so the 
+  behavior is similar when used with -O.
+
 - unittest has been split up into a package.  All old names should still work.
 
 - Issue #6466: now distutils.cygwinccompiler and distutils.emxccompiler