summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/Python-tokenize.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Python/Python-tokenize.c b/Python/Python-tokenize.c
index a7933b2..223de54 100644
--- a/Python/Python-tokenize.c
+++ b/Python/Python-tokenize.c
@@ -243,10 +243,12 @@ tokenizeriter_next(tokenizeriterobject *it)
}
else if (type == NEWLINE) {
Py_DECREF(str);
- if (it->tok->start[0] == '\r') {
- str = PyUnicode_FromString("\r\n");
- } else {
- str = PyUnicode_FromString("\n");
+ if (!it->tok->implicit_newline) {
+ if (it->tok->start[0] == '\r') {
+ str = PyUnicode_FromString("\r\n");
+ } else {
+ str = PyUnicode_FromString("\n");
+ }
}
end_col_offset++;
}