Skip to content

Commit 034c753

Browse files
author
Victor Stinner
committed
Issue python#10841: don't translate newlines for pgen
1 parent 89e3436 commit 034c753

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Parser/tokenizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,14 +892,14 @@ tok_nextc(register struct tok_state *tok)
892892
}
893893
if (tok->prompt != NULL) {
894894
char *newtok = PyOS_Readline(stdin, stdout, tok->prompt);
895+
#ifndef PGEN
895896
if (newtok != NULL) {
896897
char *translated = translate_newlines(newtok, 0, tok);
897898
PyMem_FREE(newtok);
898899
if (translated == NULL)
899900
return EOF;
900901
newtok = translated;
901902
}
902-
#ifndef PGEN
903903
if (tok->encoding && newtok && *newtok) {
904904
/* Recode to UTF-8 */
905905
Py_ssize_t buflen;

0 commit comments

Comments
 (0)