Skip to content

Commit 0e47958

Browse files
committed
fixup! Add tests for the C tokenizer and expose it as a private module
1 parent deee43b commit 0e47958

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Python/Python-tokenize.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ tokenizeriter_next(tokenizeriterobject* it)
7272
}
7373
PyObject* str = NULL;
7474
if (start == NULL || end == NULL) {
75-
str = PyUnicode_FromStringAndSize(start, end - start);
76-
} else {
7775
str = PyUnicode_FromString("");
76+
} else {
77+
str = PyUnicode_FromStringAndSize(start, end - start);
7878
}
7979
if (str == NULL) {
8080
return NULL;
@@ -192,4 +192,4 @@ PyMODINIT_FUNC
192192
PyInit__tokenize(void)
193193
{
194194
return PyModuleDef_Init(&_tokenizemodule);
195-
}
195+
}

0 commit comments

Comments
 (0)