summaryrefslogtreecommitdiff
path: root/Parser
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-05-04 05:51:03 +0000
committerMartin v. Löwis <martin@v.loewis.de>2006-05-04 05:51:03 +0000
commit25b3a09a5a2aec605c25a329cb039977c2a565fb (patch)
tree775ab853930ba74b1738fcf3601ba76d2ef0787c /Parser
parentc0b382c60807385cbf2af1675897a5eeb005063e (diff)
downloadcpython-25b3a09a5a2aec605c25a329cb039977c2a565fb.tar.gz
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 77a2cac9fb..5fcaf1b36a 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;
}
}