summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-01-09 18:13:52 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-01-09 18:13:52 (GMT)
commit5940b929095173be65c9faf04f4bdf429742c8c4 (patch)
treeab161bc17f1ca54914b0df9001ea23a8954cf8f5 /Parser
parenta118c4fa7909c62e7aee1e25e02bc4172683772e (diff)
parent1064a13bb05db8f6e86a3fe780f969fa2919a1d1 (diff)
downloadcpython-5940b929095173be65c9faf04f4bdf429742c8c4.zip
cpython-5940b929095173be65c9faf04f4bdf429742c8c4.tar.gz
cpython-5940b929095173be65c9faf04f4bdf429742c8c4.tar.bz2
Do not reset the line number because we already set file position to correct
value. (fixes error in patch for issue #18960)
Diffstat (limited to 'Parser')
-rw-r--r--Parser/tokenizer.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index 0c95b63..c32a3bf 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -514,14 +514,6 @@ fp_setreadl(struct tok_state *tok, const char* enc)
readline = _PyObject_GetAttrId(stream, &PyId_readline);
tok->decoding_readline = readline;
- /* The file has been reopened; parsing will restart from
- * the beginning of the file, we have to reset the line number.
- * But this function has been called from inside tok_nextc() which
- * will increment lineno before it returns. So we set it -1 so that
- * the next call to tok_nextc() will start with tok->lineno == 0.
- */
- tok->lineno = -1;
-
cleanup:
Py_XDECREF(stream);
Py_XDECREF(io);