py-execute-region maintains indent making making it impossible to execute indented code
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mode.el |
Fix Released
|
High
|
Andreas Roehler |
Bug Description
Consider this file:
#! /usr/bin/env python2.7
import os
if __name__ == "__main__":
print "hello"
selecting the line
>print "hello"
and running py-execute-region
results in this error:
>>> ## executing temporary file /tmp/Python2.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/tmp/Python2.
print "hello"
^
IndentationError: unexpected indent
Apparently py-execute-region maintains indentation and so this makes any indented code not executable by this means.
1)Is this meant this way or maybe py-indent-region should outdent as far as possible for the region selected?
2)Maybe py-execute-region could read a C-u supplied argument about how many indent positions to do when sending to python interpreter.
Thanks!
Changed in python-mode: | |
assignee: | nobody → Andreas Roehler (a-roehler) |
Changed in python-mode: | |
importance: | Undecided → Medium |
Changed in python-mode: | |
milestone: | none → 6.0.2 |
importance: | Medium → High |
status: | New → In Progress |
Changed in python-mode: | |
status: | Fix Committed → Fix Released |
Changed in python-mode: | |
status: | Fix Released → In Progress |
Changed in python-mode: | |
status: | Fix Committed → Fix Released |
checked in a fix,
could you try again?
Thanks,
Andreas