summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-05-04 05:51:03 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-05-04 05:51:03 (GMT)
commit777367103c9ab487fb74ce3f3ac8ea2701de328e (patch)
tree4cdca2cd62358317f4b7b83e8a8416f2949df0b4 /Parser
parent61d168a55ed08de951c69213a47896f637306908 (diff)
downloadcpython-777367103c9ab487fb74ce3f3ac8ea2701de328e.zip
cpython-777367103c9ab487fb74ce3f3ac8ea2701de328e.tar.gz
cpython-777367103c9ab487fb74ce3f3ac8ea2701de328e.tar.bz2
Patch #1475845: Raise IndentationError for unexpected indent.
Diffstat (limited to 'Parser')
-rw-r--r--Parser/parsetok.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Parser/parsetok.c b/Parser/parsetok.c
index 77a2cac..5fcaf1b 100644
--- a/Parser/parsetok.c
+++ b/Parser/parsetok.c
@@ -194,8 +194,10 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
if ((err_ret->error =
PyParser_AddToken(ps, (int)type, str, tok->lineno, col_offset,
&(err_ret->expected))) != E_OK) {
- if (err_ret->error != E_DONE)
+ if (err_ret->error != E_DONE) {
PyObject_FREE(str);
+ err_ret->token = type;
+ }
break;
}
}