From: Tarek Ziadé Date: Tue, 12 May 2009 07:01:29 +0000 (+0000) Subject: removing the assert statement so the code works when Python is run with -O X-Git-Tag: v2.7a1~1208 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ba25c25d29d68814f67ccc2e8e4fa4672d7f404;p=python removing the assert statement so the code works when Python is run with -O --- diff --git a/Lib/distutils/command/install_lib.py b/Lib/distutils/command/install_lib.py index 87e3c7aa04..411db79cc2 100644 --- a/Lib/distutils/command/install_lib.py +++ b/Lib/distutils/command/install_lib.py @@ -80,7 +80,8 @@ class install_lib(Command): if not isinstance(self.optimize, int): try: self.optimize = int(self.optimize) - assert self.optimize in (0, 1, 2) + if self.optimize not in (0, 1, 2): + raise AssertionError except (ValueError, AssertionError): raise DistutilsOptionError, "optimize must be 0, 1, or 2"