From: Dag Sverre Seljebotn Date: Fri, 16 Oct 2009 10:18:10 +0000 (+0200) Subject: Even more helpful error message (use bytes?) X-Git-Tag: 0.13.beta0~2^2~121^2~34 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=177e668417adc26778f788e6dc7b2e4edcf5c329;p=cython.git Even more helpful error message (use bytes?) --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 7f6bc2f2..41422f9f 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -42,7 +42,7 @@ find_coercion_error = { (Builtin.bytes_type, Builtin.str_type) : "Cannot convert 'bytes' object to str implicitly. This is not portable to Py3.", (Builtin.str_type, Builtin.unicode_type) : "str objects do not support coercion to unicode, use a unicode string literal instead (u'')", (Builtin.str_type, Builtin.bytes_type) : "Cannot convert 'str' to 'bytes' implicitly. This is not portable.", - (Builtin.str_type, PyrexTypes.c_char_ptr_type) : "'str' objects do not support coercion to C types.", + (Builtin.str_type, PyrexTypes.c_char_ptr_type) : "'str' objects do not support coercion to C types (use 'bytes'?).", (PyrexTypes.c_char_ptr_type, Builtin.unicode_type) : "Cannot convert 'char*' to unicode implicitly, decoding required", (PyrexTypes.c_uchar_ptr_type, Builtin.unicode_type) : "Cannot convert 'char*' to unicode implicitly, decoding required", }.get