From: Eli Zaretskii <eliz@gnu.org>
Date: Sat, 3 Jun 2023 07:20:08 +0000 (+0300)
Subject: Fix 'python-util-clone-local-variables'
X-Git-Tag: emacs-29.0.92~60
X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4897c98b6c496801aad2477c289a40a300eee27f;p=emacs.git

Fix 'python-util-clone-local-variables'

* lisp/progmodes/python.el (python-util-clone-local-variables):
Avoid signaling an error when a local variable is unbound.
Patch by Ernesto Alfonso <erjoalgo@gmail.com>.  (Bug#63818)
---

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 974e07c3c6a..fd196df7550 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -6094,7 +6094,8 @@ Optional argument REGEXP selects variables to clone and defaults
 to \"^python-\"."
   (mapc
    (lambda (pair)
-     (and (symbolp (car pair))
+     (and (consp pair)
+          (symbolp (car pair))
           (string-match (or regexp "^python-")
                         (symbol-name (car pair)))
           (set (make-local-variable (car pair))