Skip to content

Commit c1786ea

Browse files
committed
Use UTF-8 for a docstring that contains non-ASCII chars.
1 parent 10ab4ae commit c1786ea

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Modules/_heapqmodule.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ maintains the heap invariant!\n");
515515
PyDoc_STRVAR(__about__,
516516
"Heap queues\n\
517517
\n\
518-
[explanation by François Pinard]\n\
518+
[explanation by Fran\xc3\xa7ois Pinard]\n\
519519
\n\
520520
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for\n\
521521
all k, counting elements from 0. For the sake of comparison,\n\
@@ -609,11 +609,12 @@ From all times, sorting has always been a Great Art! :-)\n");
609609
PyMODINIT_FUNC
610610
init_heapq(void)
611611
{
612-
PyObject *m;
612+
PyObject *m, *about;
613613

614614
m = Py_InitModule3("_heapq", heapq_methods, module_doc);
615615
if (m == NULL)
616616
return;
617-
PyModule_AddObject(m, "__about__", PyString_FromString(__about__));
617+
about = PyUnicode_DecodeUTF8(__about__, strlen(__about__), NULL);
618+
PyModule_AddObject(m, "__about__", about);
618619
}
619620

0 commit comments

Comments
 (0)