diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-07-22 08:55:19 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-07-22 08:55:19 (GMT) |
commit | af2406f21598c136980cebac6e7e9ecdc353ded6 (patch) | |
tree | 6b0ae33b29538815109289ce2109ed61293955ac /Lib | |
parent | bee2e1897b0194290ce3f5a4b19241b1566dc392 (diff) | |
download | cpython-af2406f21598c136980cebac6e7e9ecdc353ded6.zip cpython-af2406f21598c136980cebac6e7e9ecdc353ded6.tar.gz cpython-af2406f21598c136980cebac6e7e9ecdc353ded6.tar.bz2 |
Issue #6545: Removed assert statements in distutils.Extension, so the behavior is similar when used with -O
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/distutils/extension.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/distutils/extension.py b/Lib/distutils/extension.py index 53ca8fd..6af1810 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 |