Minor issue with "except" indentation

Bug #882455 reported by Ryan Kaskel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
Medium
Andreas Roehler

Bug Description

If you try the following:

def foo():
    try:
        foo = True
    except:
        foo = False

and then move the cursor to the line with "except" on it and press tab, it will dedent it and won't let you indent it to the proper position.

The normal behavior for tab seems to cycle through possible indentation levels but this doesn't happen here.

This is a very minor issue and only came up when trying to reformat some code.

Changed in python-mode:
assignee: nobody → Andreas Roehler (a-roehler)
Changed in python-mode:
milestone: none → 6.0.4
importance: Undecided → Medium
status: New → Confirmed
Changed in python-mode:
status: Confirmed → Fix Committed
Revision history for this message
Ryan Kaskel (ryankaskel) wrote :

thanks -- this fixed it.

After pulling in the changes, I now get an error each time python-mode loads:

File mode specification error: (file-error "Cannot open load file" "/pymacs/pymacs.el")

Revision history for this message
Ryan Kaskel (ryankaskel) wrote :

I've marked this as new (not sure if that is correct). I think the same thing happens if you have multiple except statements.

def foo():
    try:
        x = 1
    except SystemError:
        f = 1
except KeyError: <--- can indent this
        p = 1

Changed in python-mode:
status: Fix Committed → New
Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 882455] Re: Minor issue with "except" indentation

Am 30.10.2011 09:22, schrieb Ryan Kaskel:
> I've marked this as new (not sure if that is correct).

Hi Ryan,

think its helpful, if only assignees toggle the flags.
Flags are helpful to range the tasks - but only if the one in charge may
rely upon

I think the same
> thing happens if you have multiple except statements.
>

if the previous example was fixed, a new report is more helpful.
Otherwise people in later times must dig through a bulk of comments.

May you make a new entry? I'll switch that back to "commited" then.

Thanks,

Andreas

> def foo():
> try:
> x = 1
> except SystemError:
> f = 1
> except KeyError:<--- can indent this
> p = 1
>
> ** Changed in: python-mode
> Status: Fix Committed => New
>

Changed in python-mode:
status: New → Fix Committed
Changed in python-mode:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.