From ae51384fa6905a6cb4280feabbd2a15b3c437ffc Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 21 Aug 2009 09:55:43 +0200 Subject: [PATCH] Py3 fix --- Cython/Compiler/ExprNodes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index c291431c..407cd83f 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -5257,7 +5257,8 @@ class NoneCheckNode(CoercionNode): "if (unlikely(%s == Py_None)) {" % self.arg.result()) code.putln('PyErr_SetString(%s, "%s"); %s ' % ( self.exception_type_cname, - StringEncoding.escape_byte_string(self.exception_message), + StringEncoding.escape_byte_string( + self.exception_message.encode('UTF-8')), code.error_goto(self.pos))) code.putln("}") -- 2.26.2