Keep python.el compatible with older Emacsen

* progmodes/python.el (python-shell-send-string): Don't assume
comint-max-line-length is defined (bug#50503).
This commit is contained in:
Augusto Stoffel 2021-09-11 15:39:13 +02:00 committed by Lars Ingebrigtsen
parent ef65d717d0
commit 84e35ff786

View 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)))