summaryrefslogtreecommitdiff
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index e617e2932d0..6c11a478942 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -3300,7 +3300,8 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'."
(end-of-line)
(when (not (python-syntax-context 'paren))
(skip-syntax-backward "^)")))
- (while (python-syntax-context 'paren)
+ (while (and (python-syntax-context 'paren)
+ (not (eobp)))
(goto-char (1+ (point-marker))))
(point-marker)))
(let ((paragraph-start "\f\\|[ \t]*$")
@@ -3311,7 +3312,8 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'."
(while (not (eobp))
(forward-line 1)
(python-indent-line)
- (goto-char (line-end-position)))) t)
+ (goto-char (line-end-position))))
+ t)
;;; Skeletons