docstrings in classes were neither escaped nor byte encoded
authorStefan Behnel <scoder@users.berlios.de>
Tue, 12 Aug 2008 09:55:42 +0000 (11:55 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Tue, 12 Aug 2008 09:55:42 +0000 (11:55 +0200)
Cython/Compiler/Nodes.py

index b39fc13dff18584a922a0fb79fecec1e61250d61..266fc4d6460d4f26aa784f029a2cf865b1b86d8f 100644 (file)
@@ -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 = " %