From c2ca009da4cc2c81be364a1ddac15e8c7585ddf6 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 9 Mar 2023 00:43:31 +0200 Subject: [PATCH] Avoid potential infloop * lisp/progmodes/python.el (python-info-dedenter-opening-block-positions): Avoid potential infloop (bug#62031). --- lisp/progmodes/python.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 81475f31f60..630250c15c3 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -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)) -- 2.39.2