From bb8d6907c08e41586fcb6b021699a26e789789ab Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 10 Oct 2007 02:46:46 -0700 Subject: [PATCH] Fix c++ error when using 'is' with different types. --- Cython/Compiler/ExprNodes.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 4d93dfa0..ac3656f7 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -2909,12 +2909,16 @@ class CmpNode: richcmp_constants[op], code.error_goto_if_null(result_code, self.pos))) else: + if operand1.type.is_pyobject: + res1, res2 = operand1.py_result(), operand2.py_result() + else: + res1, res2 = operand1.result_code, operand2.result_code code.putln("%s = %s(%s %s %s);" % ( result_code, coerce_result, - operand1.result_code, + res1, self.c_operator(op), - operand2.result_code)) + res2)) def c_operator(self, op): if op == 'is': -- 2.26.2