diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 10845b236304f3db8e12b8c0663cb33e1da47572..5073f2bc23ad2d7123f4472260be57405af5e907 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1127,8 +1127,8 @@ Don't save anything for STR matching `inferior-python-filter-regexp'." ((string-match ".*\n" s) s) ((or (eq t (compare-strings s nil nil "_emacs_ok\n" nil (length s))) - (eq t (compare-strings s nil nil "_emacs_out " nil - (min (length "_emacs_out ") (length s))))) + (let ((end (min (length "_emacs_out ") (length s)))) + (eq t (compare-strings s nil end "_emacs_out " nil end)))) (setq python-preoutput-leftover s) "") (t s)))