Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Objects/unicodeobject.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -1720,6 +1720,9 @@ unicode_is_singleton(PyObject *unicode)

PyASCIIObject *ascii = _PyASCIIObject_CAST(unicode);
if (ascii->length == 1) {
if (!PyUnicode_IS_COMPACT(unicode) && _PyUnicode_DATA_ANY(unicode) == NULL) {
return 0;
}
Py_UCS4 ch = PyUnicode_READ_CHAR(unicode, 0);
if (ch < 256 && LATIN1(ch) == unicode) {
return 1;
Expand Down
Loading