diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f402ad83cca..50b9d1b0eee 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -4492,6 +4492,7 @@ point's current `syntax-ppss'." (python-nav-backward-sexp) (setq backward-sexp-point (point)) (and (= indentation (current-indentation)) + (not (bobp)) ; Prevent infloop. (looking-at-p (concat "[uU]?[rR]?" (python-rx string-delimiter)))))