diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index c7bb2d9..218c6e4 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2556,14 +2556,11 @@ python-shell-font-lock-cleanup-buffer (defun python-shell-font-lock-comint-output-filter-function (output) "Clean up the font-lock buffer after any OUTPUT." - (if (and (not (string= "" output)) - ;; Is end of output and is not just a prompt. - (not (member - (python-shell-comint-end-of-output-p - (ansi-color-filter-apply output)) - '(nil 0)))) - ;; If output is other than an input prompt then "real" output has - ;; been received and the font-lock buffer must be cleaned up. + (if (let ((output (ansi-color-filter-apply output))) + (and (python-shell-comint-end-of-output-p output) + (not (string-match "\\.\\.\\." output)))) + ;; If output ends with an initial (not continuation) input prompt + ;; then the font-lock buffer must be cleaned up. (python-shell-font-lock-cleanup-buffer) ;; Otherwise just add a newline. (python-shell-font-lock-with-font-lock-buffer