summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorAugusto Stoffel <arstoffel@gmail.com>2021-09-11 15:39:13 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-09-11 15:39:32 +0200
commit84e35ff78667a730d6f23d995ff649ded32cd420 (patch)
tree2797c4acb1e4d9cf9d3fdf3eef7d9cce9c898e3b /lisp
parentef65d717d0a1eeb6530176b59aa03cd09efb5fa9 (diff)
downloademacs-84e35ff78667a730d6f23d995ff649ded32cd420.tar.gz
emacs-84e35ff78667a730d6f23d995ff649ded32cd420.tar.bz2
emacs-84e35ff78667a730d6f23d995ff649ded32cd420.zip
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).
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/python.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 9cf88ea656b..d9fc5c50091 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -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)))