[Patches] [ python-Patches-1475845 ] IndentationError for unexpected indent

SourceForge.net noreply at sourceforge.net
Sun Apr 30 13:20:12 CEST 2006


Patches item #1475845, was opened at 2006-04-24 23:12
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1475845&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Parser/Compiler
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Roger Miller (rcmiller)
Assigned to: Martin v. Löwis (loewis)
Summary: IndentationError for unexpected indent

Initial Comment:
This patch raises an IndentationError rather than a
generic "invalid syntax" error for unexpected
indentation.  Code to do this was already in
pythonrun.c:err_input() but was not being reached due
to a failure to pass the INDENT token in the perrdetail
structure.  The patch also adds tests for the 3 kinds
of indentation errors (unexpected indent, no indent
where required, invalid outdent level) to test_syntax.py .


----------------------------------------------------------------------

>Comment By: Georg Brandl (gbrandl)
Date: 2006-04-30 11:20

Message:
Logged In: YES 
user_id=849994

Martin, do we want to change this? I myself have always
wondered what IndentationError was for if it was not raised
in these cases.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1475845&group_id=5470


More information about the Patches mailing list