]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
fix loop on unterminated triple quotes
authorGuido van Rossum <guido@python.org>
Tue, 17 Jan 1995 16:12:13 +0000 (16:12 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 17 Jan 1995 16:12:13 +0000 (16:12 +0000)
Parser/tokenizer.c

index 75b63fbcb1b6916ea471af6af0b6e35690e3fa70..083ef0e9a2e738fe59f666dfd761185c9d961126 100644 (file)
@@ -257,7 +257,12 @@ tok_nextc(tok)
                        }
                        else {
                                cur = tok->cur - tok->buf;
-                               tok->done = E_OK;
+                               if (feof(tok->fp)) {
+                                       tok->done = E_EOF;
+                                       done = 1;
+                               }
+                               else
+                                       tok->done = E_OK;
                        }
                        tok->lineno++;
                        /* Read until '\n' or EOF */