From: Tarek Ziadé Date: Wed, 22 Jul 2009 08:55:19 +0000 (+0000) Subject: Issue #6545: Removed assert statements in distutils.Extension, so the behavior is... X-Git-Tag: v2.7a1~726 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=af2406f21598c136980cebac6e7e9ecdc353ded6;p=python Issue #6545: Removed assert statements in distutils.Extension, so the behavior is similar when used with -O --- diff --git a/Lib/distutils/extension.py b/Lib/distutils/extension.py index 53ca8fd0c5..6af1810801 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 77e3ac6aca..6b4dac506b 100644 --- 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