From d2a6bd70d19f84592235691eb25356bcc5275880 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Sat, 11 Sep 2021 15:29:06 +0200 Subject: [PATCH] Keep python.el compatible with older Emacsen * progmodes/python.el (python-shell-send-string): Don't assume comint-max-line-length is defined. --- lisp/progmodes/python.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index e71a8102df..b17d740036 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3155,7 +3155,9 @@ python-shell-send-string (python-shell--encode-string (or (buffer-file-name) ""))))) (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))) -- 2.31.1