aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorAugusto Stoffel2021-09-11 15:39:13 +0200
committerLars Ingebrigtsen2021-09-11 15:39:32 +0200
commit84e35ff78667a730d6f23d995ff649ded32cd420 (patch)
tree2797c4acb1e4d9cf9d3fdf3eef7d9cce9c898e3b /lisp/progmodes/python.el
parentef65d717d0a1eeb6530176b59aa03cd09efb5fa9 (diff)
downloademacs-84e35ff78667a730d6f23d995ff649ded32cd420.tar.gz
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/progmodes/python.el')
-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."
3163 (python-shell--encode-string (or (buffer-file-name) 3163 (python-shell--encode-string (or (buffer-file-name)
3164 "<string>"))))) 3164 "<string>")))))
3165 (if (or (null (process-tty-name process)) 3165 (if (or (null (process-tty-name process))
3166 (<= (string-bytes code) comint-max-line-length)) 3166 (<= (string-bytes code)
3167 (or (bound-and-true-p comint-max-line-length)
3168 1024))) ;; For Emacs < 28
3167 (comint-send-string process code) 3169 (comint-send-string process code)
3168 (let* ((temp-file-name (with-current-buffer (process-buffer process) 3170 (let* ((temp-file-name (with-current-buffer (process-buffer process)
3169 (python-shell--save-temp-file string))) 3171 (python-shell--save-temp-file string)))