]> git.eshelyaron.com Git - emacs.git/commitdiff
Keep python.el compatible with older Emacsen
authorAugusto Stoffel <arstoffel@gmail.com>
Sat, 11 Sep 2021 13:39:13 +0000 (15:39 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 11 Sep 2021 13:39:32 +0000 (15:39 +0200)
* progmodes/python.el (python-shell-send-string): Don't assume
comint-max-line-length is defined (bug#50503).

lisp/progmodes/python.el

index 9cf88ea656b67e88c7e27a8c5105ff7f0d09b3af..d9fc5c50091be2949393f45a76fe63c718bf1603 100644 (file)
@@ -3163,7 +3163,9 @@ t when called interactively."
                       (python-shell--encode-string (or (buffer-file-name)
                                                        "<string>")))))
     (if (or (null (process-tty-name process))
-            (<= (string-bytes code) comint-max-line-length))
+            (<= (string-bytes code)
+                (or (bound-and-true-p comint-max-line-length)
+                    1024))) ;; For Emacs < 28
         (comint-send-string process code)
       (let* ((temp-file-name (with-current-buffer (process-buffer process)
                                (python-shell--save-temp-file string)))