ob-python: Check for end of output in org-babel-python-send-string
This is an attempt to mitigate occasional leaky prompts in CI. My current hypothesis is that this could happen if the comint-output ends between `org-babel-python-eoe-indicator' and the new prompt. Then the new prompt could be injected into the output of the next unit test. To avoid this, check we are at an ending prompt before exiting `org-babel-python-send-string'. https://list.orgmode.org/873506j7ky.fsf@localhost/ * lisp/ob-python.el (org-babel-python-send-string): Add check for `python-shell-comint-end-of-output-p' to stop while loop accepting process output.
This commit is contained in:
parent
061988c024
commit
1eb5987589
|
@ -399,9 +399,10 @@ finally:
|
||||||
(org-babel-python-without-earmuffs session)))
|
(org-babel-python-without-earmuffs session)))
|
||||||
(python-shell-send-string body))
|
(python-shell-send-string body))
|
||||||
;; same as `python-shell-comint-end-of-output-p' in emacs-25.1+
|
;; same as `python-shell-comint-end-of-output-p' in emacs-25.1+
|
||||||
(while (not (string-match
|
(while (not (and (python-shell-comint-end-of-output-p string-buffer)
|
||||||
org-babel-python-eoe-indicator
|
(string-match
|
||||||
string-buffer))
|
org-babel-python-eoe-indicator
|
||||||
|
string-buffer)))
|
||||||
(accept-process-output (get-buffer-process (current-buffer))))
|
(accept-process-output (get-buffer-process (current-buffer))))
|
||||||
(org-babel-chomp (substring string-buffer 0 (match-beginning 0))))))
|
(org-babel-chomp (substring string-buffer 0 (match-beginning 0))))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue