]> granicus.if.org Git - python/commitdiff
Issue #10841: don't translate newlines for pgen
authorVictor Stinner <victor.stinner@haypocalc.com>
Fri, 7 Jan 2011 18:56:19 +0000 (18:56 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Fri, 7 Jan 2011 18:56:19 +0000 (18:56 +0000)
Parser/tokenizer.c

index 1eb62aa2a093a13f21492e7894323cefeb0a2fb2..3f6be2f640eca7a3ecccbaa4c2878367a9b0309c 100644 (file)
@@ -892,6 +892,7 @@ tok_nextc(register struct tok_state *tok)
         }
         if (tok->prompt != NULL) {
             char *newtok = PyOS_Readline(stdin, stdout, tok->prompt);
+#ifndef PGEN
             if (newtok != NULL) {
                 char *translated = translate_newlines(newtok, 0, tok);
                 PyMem_FREE(newtok);
@@ -899,7 +900,6 @@ tok_nextc(register struct tok_state *tok)
                     return EOF;
                 newtok = translated;
             }
-#ifndef PGEN
             if (tok->encoding && newtok && *newtok) {
                 /* Recode to UTF-8 */
                 Py_ssize_t buflen;