projects
/
platform
/
upstream
/
python-cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c5ec32f
)
disable 'assert' when Python runtime runs with -O/-OO
author
Stefan Behnel
<stefan_ml@behnel.de>
Thu, 29 Aug 2013 19:54:17 +0000
(21:54 +0200)
committer
Stefan Behnel
<stefan_ml@behnel.de>
Thu, 29 Aug 2013 19:54:17 +0000
(21:54 +0200)
Cython/Compiler/Nodes.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/Nodes.py
b/Cython/Compiler/Nodes.py
index
852d628
..
fe7adb3
100644
(file)
--- 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):