From 8be99465739d09dcb2f6bf01cf2c25bb8ff38142 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 2 May 2010 17:59:06 +0200 Subject: [PATCH] code simplification --- Cython/Compiler/ExprNodes.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index eb164973..8fa34fcf 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -6252,17 +6252,10 @@ class CoerceIntToBytesNode(CoerceToPyTypeNode): '"value too large to pack into a byte"); %s' % ( code.error_goto(self.pos))) code.putln('}') - temp = None - if arg.type is not PyrexTypes.c_char_type: - temp = code.funcstate.allocate_temp(PyrexTypes.c_char_type, manage_ref=False) - code.putln("%s = (char)%s;" % (temp, arg_result)) - arg_result = temp - code.putln('%s = PyBytes_FromStringAndSize(&%s, 1); %s' % ( + code.putln('%s = PyBytes_FromStringAndSize((const char*)&%s, 1); %s' % ( self.result(), arg_result, code.error_goto_if_null(self.result(), self.pos))) - if temp is not None: - code.funcstate.release_temp(temp) code.put_gotref(self.py_result()) -- 2.26.2