summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoam Hershtig <noam@beeeye.co>2019-02-24 22:22:17 +0200
committerNoam Hershtig <noam@beeeye.co>2019-02-25 20:28:17 +0200
commitf8e58c5eff854bdafdb403977c033d223053a17d (patch)
treed79221862b2cc98cf955e63f66e566b8206889d8
parent412b232e252329e2320e171fd94625a52594b18c (diff)
downloadcython-f8e58c5eff854bdafdb403977c033d223053a17d.tar.gz
Test conditional GILStatNode with compile-time constant as condition
-rw-r--r--tests/run/nogil_conditional.pyx8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/run/nogil_conditional.pyx b/tests/run/nogil_conditional.pyx
index 56a05bb5c..eba22d5b2 100644
--- a/tests/run/nogil_conditional.pyx
+++ b/tests/run/nogil_conditional.pyx
@@ -96,6 +96,10 @@ def test_nested():
return res
+DEF FREE_GIL = True
+DEF FREE_GIL_FALSE = False
+
+
def test_nested_condition_false():
"""
>>> test_nested_condition_false()
@@ -103,12 +107,12 @@ def test_nested_condition_false():
"""
cdef int res = 0
- with gil(False):
+ with gil(FREE_GIL_FALSE):
res = f_gil(res)
with nogil(False):
res = f_gil(res)
- with nogil(True):
+ with nogil(FREE_GIL):
res = f_nogil(res)
with gil(False):
res = f_nogil(res)