mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 18:36:26 +00:00
ob-python: fix startup messages leaking into output
* lisp/ob-python.el (org-babel-python-initiate-session-by-key): Remove workaround for emacs<24.1. Sleep after starting Python, to prevent startup messages leaking into output results. * testing/lisp/test-ob-python.el (test-ob-python/session-multiline): Remove workaround for startup message leaking into results.
This commit is contained in:
parent
74b6860b76
commit
5d289d2b3e
|
@ -187,15 +187,13 @@ then create. Return the initialized session."
|
|||
(concat org-babel-python-command " -i")
|
||||
org-babel-python-command)))
|
||||
(cond
|
||||
((and (eq 'python org-babel-python-mode)
|
||||
(fboundp 'run-python)) ; python.el
|
||||
(if (not (version< "24.1" emacs-version))
|
||||
(run-python cmd)
|
||||
(unless py-buffer
|
||||
(setq py-buffer (org-babel-python-with-earmuffs session)))
|
||||
(let ((python-shell-buffer-name
|
||||
(org-babel-python-without-earmuffs py-buffer)))
|
||||
(run-python cmd))))
|
||||
((eq 'python org-babel-python-mode) ; python.el
|
||||
(unless py-buffer
|
||||
(setq py-buffer (org-babel-python-with-earmuffs session)))
|
||||
(let ((python-shell-buffer-name
|
||||
(org-babel-python-without-earmuffs py-buffer)))
|
||||
(run-python cmd)
|
||||
(sleep-for 0 10)))
|
||||
((and (eq 'python-mode org-babel-python-mode)
|
||||
(fboundp 'py-shell)) ; python-mode.el
|
||||
(require 'python-mode)
|
||||
|
|
|
@ -102,9 +102,6 @@ return x
|
|||
(org-babel-execute-src-block)))))
|
||||
|
||||
(ert-deftest test-ob-python/session-multiline ()
|
||||
;; FIXME workaround to prevent starting prompt leaking into output
|
||||
(run-python)
|
||||
(sleep-for 0 10)
|
||||
(should
|
||||
(equal "20"
|
||||
(org-test-with-temp-text "#+begin_src python :session :results output
|
||||
|
|
Loading…
Reference in a new issue