]> granicus.if.org Git - python/commitdiff
Issue #6545: Removed assert statements in distutils.Extension, so the behavior is...
authorTarek Ziadé <ziade.tarek@gmail.com>
Wed, 22 Jul 2009 08:55:19 +0000 (08:55 +0000)
committerTarek Ziadé <ziade.tarek@gmail.com>
Wed, 22 Jul 2009 08:55:19 +0000 (08:55 +0000)
Lib/distutils/extension.py
Misc/NEWS

index 53ca8fd0c579f2d8fd58f0bb79d3ad66c37a4ffb..6af18108012df751f8914f6d5f2b00adfb80b992 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 77e3ac6acae56258ac874d6d6d77d5b4910c258b..6b4dac506bc1af343f970cc42a8a8b85a6ce164f 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -349,6 +349,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 #6431: Make Fraction type return NotImplemented when it doesn't