[Python-checkins] r74163 - in python/trunk: Lib/distutils/extension.py Misc/NEWS

tarek.ziade python-checkins at python.org
Wed Jul 22 10:55:19 CEST 2009


Author: tarek.ziade
Date: Wed Jul 22 10:55:19 2009
New Revision: 74163
Log:
Issue #6545: Removed assert statements in distutils.Extension, so the behavior is similar when used with -O
Modified:
 python/trunk/Lib/distutils/extension.py
 python/trunk/Misc/NEWS
Modified: python/trunk/Lib/distutils/extension.py
==============================================================================
--- python/trunk/Lib/distutils/extension.py	(original)
+++ python/trunk/Lib/distutils/extension.py	Wed Jul 22 10:55:19 2009
@@ -103,10 +103,11 @@
 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
Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Wed Jul 22 10:55:19 2009
@@ -349,6 +349,9 @@
 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


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /