From: Tarek Ziadé Date: Wed, 22 Jul 2009 09:03:01 +0000 (+0000) Subject: Merged revisions 74164 via svnmerge from X-Git-Tag: v3.1.1rc1~72 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3cc12f69421f14c4d919cc015b71259056b3bc60;p=python Merged revisions 74164 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r74164 | tarek.ziade | 2009-07-22 10:57:28 +0200 (Wed, 22 Jul 2009) | 9 lines 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 ........ ................ --- 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 76ead6f754..4d099a12f4 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -892,6 +892,9 @@ Core and Builtins Library ------- +- Issue #6545: Removed assert statements in distutils.Extension, so the + behavior is similar when used with -O. + - Issue #6459: distutils.command.build_ext.get_export_symbols now uses the "PyInit" prefix, rather than "init".