[Python-3000-checkins] r57365 - python/branches/py3k/Modules/_heapqmodule.c

neal.norwitz python-3000-checkins at python.org
Fri Aug 24 01:58:44 CEST 2007


Author: neal.norwitz
Date: Fri Aug 24 01:58:43 2007
New Revision: 57365

Modified:
   python/branches/py3k/Modules/_heapqmodule.c
Log:
Use UTF-8 for a docstring that contains non-ASCII chars.


Modified: python/branches/py3k/Modules/_heapqmodule.c
==============================================================================
--- python/branches/py3k/Modules/_heapqmodule.c	(original)
+++ python/branches/py3k/Modules/_heapqmodule.c	Fri Aug 24 01:58:43 2007
@@ -515,7 +515,7 @@
 PyDoc_STRVAR(__about__,
 "Heap queues\n\
 \n\
-[explanation by François Pinard]\n\
+[explanation by Fran\xc3\xa7ois Pinard]\n\
 \n\
 Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for\n\
 all k, counting elements from 0.  For the sake of comparison,\n\
@@ -609,11 +609,12 @@
 PyMODINIT_FUNC
 init_heapq(void)
 {
-	PyObject *m;
+	PyObject *m, *about;
 
 	m = Py_InitModule3("_heapq", heapq_methods, module_doc);
 	if (m == NULL)
     		return;
-	PyModule_AddObject(m, "__about__", PyString_FromString(__about__));
+	about = PyUnicode_DecodeUTF8(__about__, strlen(__about__), NULL);
+	PyModule_AddObject(m, "__about__", about);
 }
 


More information about the Python-3000-checkins mailing list