summaryrefslogtreecommitdiffstats
path: root/Python/Python-tokenize.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/Python-tokenize.c')
-rw-r--r--Python/Python-tokenize.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/Python/Python-tokenize.c b/Python/Python-tokenize.c
index 4d21793..83a129c 100644
--- a/Python/Python-tokenize.c
+++ b/Python/Python-tokenize.c
@@ -247,6 +247,17 @@ tokenizeriter_next(tokenizeriterobject *it)
}
end_col_offset++;
}
+ else if (type == NL) {
+ if (it->tok->implicit_newline) {
+ Py_DECREF(str);
+ str = PyUnicode_FromString("");
+ }
+ }
+
+ if (str == NULL) {
+ Py_DECREF(line);
+ goto exit;
+ }
}
result = Py_BuildValue("(iN(nn)(nn)N)", type, str, lineno, col_offset, end_lineno, end_col_offset, line);