From f6df9115230bd573790cd0b508adadc58c6ba718 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 12 Aug 2008 11:55:42 +0200 Subject: [PATCH] docstrings in classes were neither escaped nor byte encoded --- Cython/Compiler/Nodes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index b39fc13d..266fc4d6 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -12,7 +12,8 @@ import TypeSlots from PyrexTypes import py_object_type, error_type, CTypedefType, CFuncType from Symtab import ModuleScope, LocalScope, GeneratorLocalScope, \ StructOrUnionScope, PyClassScope, CClassScope -from Cython.Utils import open_new_file, replace_suffix, EncodedString +from Cython.Utils import open_new_file, replace_suffix +from Cython.Utils import EncodedString, escape_byte_string import Options import ControlFlow @@ -1522,7 +1523,7 @@ class DefNode(FuncDefNode): code.putln( 'static char %s[] = "%s";' % ( self.entry.doc_cname, - self.entry.doc)) + escape_byte_string(self.entry.doc.utf8encode()))) if with_pymethdef: code.put( "static PyMethodDef %s = " % -- 2.26.2