From: Robert Bradshaw Date: Wed, 10 Oct 2007 09:46:46 +0000 (-0700) Subject: Fix c++ error when using 'is' with different types. X-Git-Tag: 0.9.6.14~29^2~126 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bb8d6907c08e41586fcb6b021699a26e789789ab;p=cython.git Fix c++ error when using 'is' with different types. --- 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':