From: Dag Sverre Seljebotn Date: Sun, 3 Aug 2008 17:51:46 +0000 (+0200) Subject: Fixed bug with BoolNode result_code X-Git-Tag: 0.9.8.1~95^2~1 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=9262420f987e3215b11aecb5fe703846931e1daf;p=cython.git Fixed bug with BoolNode result_code --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index a37f9e75..636e162f 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -628,7 +628,7 @@ class BoolNode(ConstNode): return self.value def calculate_result_code(self): - return int(self.value) + return str(int(self.value)) class NullNode(ConstNode): type = PyrexTypes.c_null_ptr_type diff --git a/tests/run/bint.pyx b/tests/run/bint.pyx new file mode 100644 index 00000000..827cf042 --- /dev/null +++ b/tests/run/bint.pyx @@ -0,0 +1,25 @@ + +""" +>>> call_test() +False +True +False +True +True +True +True +""" + +cdef test(bint value): + print value + +def call_test(): + test(False) + test(True) + test(0) + test(234) + test(-1) + x = True + test(x) + x = 3242 + test(x)