summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-07-22 08:57:28 +0000
committerTarek Ziadé <ziade.tarek@gmail.com>2009-07-22 08:57:28 +0000
commit2f19bb1447ace998a375c96708a34058c2b4ffff (patch)
tree80ec631d87c2d2c4f26795c25c52975f668bc110
parent93f2cd2e3a88c69601e85185f11aa264d8920047 (diff)
downloadcpython-git-2f19bb1447ace998a375c96708a34058c2b4ffff.tar.gz
Merged revisions 74163 via svnmerge from
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 ........
-rw-r--r--Lib/distutils/extension.py9
-rw-r--r--Misc/NEWS3
2 files changed, 8 insertions, 4 deletions
diff --git a/Lib/distutils/extension.py b/Lib/distutils/extension.py
index 16d2bef6f4..5c07bdae82 100644
--- a/Lib/distutils/extension.py
+++ b/Lib/distutils/extension.py
@@ -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
diff --git a/Misc/NEWS b/Misc/NEWS
index da7fa5bebe..3f25faf4b9 100644
--- 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