]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid potential infloop
authorDmitry Gutov <dgutov@yandex.ru>
Wed, 8 Mar 2023 22:43:31 +0000 (00:43 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 8 Mar 2023 22:43:31 +0000 (00:43 +0200)
* lisp/progmodes/python.el
(python-info-dedenter-opening-block-positions):
Avoid potential infloop (bug#62031).

lisp/progmodes/python.el

index 81475f31f60612ff1e58fff94c83428e50dfed58..630250c15c369bd3c17db23a899f3cc69f8db563 100644 (file)
@@ -5792,9 +5792,9 @@ likely an invalid python file."
           (catch 'exit
             (while (python-nav--syntactically
                     (lambda ()
-                      (cl-loop for pt = (re-search-backward (python-rx block-start) nil t)
-                               until (memq (char-before) '(nil ?\s ?\t ?\n))
-                               finally return pt))
+                      (cl-loop while (re-search-backward (python-rx block-start) nil t)
+                               if (memq (char-before) '(nil ?\s ?\t ?\n))
+                               return t))
                     #'<)
               (let ((indentation (current-indentation)))
                 (when (and (not (memq indentation collected-indentations))