Commit 034c7537 authored by Victor Stinner's avatar Victor Stinner

Issue #10841: don't translate newlines for pgen

parent 89e34366
...@@ -892,6 +892,7 @@ tok_nextc(register struct tok_state *tok) ...@@ -892,6 +892,7 @@ tok_nextc(register struct tok_state *tok)
} }
if (tok->prompt != NULL) { if (tok->prompt != NULL) {
char *newtok = PyOS_Readline(stdin, stdout, tok->prompt); char *newtok = PyOS_Readline(stdin, stdout, tok->prompt);
#ifndef PGEN
if (newtok != NULL) { if (newtok != NULL) {
char *translated = translate_newlines(newtok, 0, tok); char *translated = translate_newlines(newtok, 0, tok);
PyMem_FREE(newtok); PyMem_FREE(newtok);
...@@ -899,7 +900,6 @@ tok_nextc(register struct tok_state *tok) ...@@ -899,7 +900,6 @@ tok_nextc(register struct tok_state *tok)
return EOF; return EOF;
newtok = translated; newtok = translated;
} }
#ifndef PGEN
if (tok->encoding && newtok && *newtok) { if (tok->encoding && newtok && *newtok) {
/* Recode to UTF-8 */ /* Recode to UTF-8 */
Py_ssize_t buflen; Py_ssize_t buflen;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment