py-execute-region: 'Indentation error' with multiple lines
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mode.el |
Fix Released
|
Wishlist
|
Andreas Roehler |
Bug Description
With both emacs23 and emacs24, the latest python-mode in trunk raises 'IndentationError: unexpected indent' when issuing py-execute-region when multiple indented lines are selected.
To reproduce the issue, copy the following snippet in a buffer:
----
if __name__ == '__main__':
print("one")
print("two")
----
If you select the last two lines and issue py-execute-region I get:
----
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> >>> >>> >>> Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/tmp/python-
print("two")
^
IndentationError: unexpected indent
>>> Traceback (most recent call last):
File a.py, line 4
File "/tmp/python-
print("two")
^
IndentationError: unexpected indent
----
(oddly the error appears twice)
Notice that py-execute-buffer works correctly when selecting all three lines of the snippet, or when selecting just one line - indented or not.
Changed in python-mode: | |
assignee: | nobody → Andreas Roehler (a-roehler) |
importance: | Undecided → Wishlist |
status: | New → In Progress |
Changed in python-mode: | |
status: | Fix Committed → Fix Released |
Please re-open if not done. There some issues WRT tests. Command itself should work.