From: Stefan Behnel Date: Thu, 29 Aug 2013 19:54:17 +0000 (+0200) Subject: disable 'assert' when Python runtime runs with -O/-OO X-Git-Tag: 0.20b1~356 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=738ce40442da06b38571ff131e5996297a428e62;p=platform%2Fupstream%2Fpython-cython.git disable 'assert' when Python runtime runs with -O/-OO --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 852d628..fe7adb3 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -5183,6 +5183,7 @@ class AssertStatNode(StatNode): def generate_execution_code(self, code): code.putln("#ifndef CYTHON_WITHOUT_ASSERTIONS") + code.putln("if (unlikely(!Py_OptimizeFlag)) {") self.cond.generate_evaluation_code(code) code.putln( "if (unlikely(!%s)) {" % @@ -5203,6 +5204,8 @@ class AssertStatNode(StatNode): "}") self.cond.generate_disposal_code(code) self.cond.free_temps(code) + code.putln( + "}") code.putln("#endif") def generate_function_definitions(self, env, code):