|
From: | Barton, Mark |
Subject: | bug#50514: 28.0.50; org inline call to python src block req C-g to break |
Date: | Sun, 28 Aug 2022 00:38:18 +0000 |
I tried something that was suggested last September 14th by Augusto Stoffel. I had not tried it because changing the sleep from 10 to 90 was my workaround.
One thing that might work is to block until the shell is ready with something like
(run-python)
(with-current-buffer *the-shell-buffer*
(while (not python-shell--first-prompt-received)
(accept-process-output (get-buffer-process (current-buffer)))))
The patch that is working for me now is:
modified lisp/org/ob-python.el
@@ -198,7 +198,10 @@ org-babel-python-initiate-session-by-key
(let ((python-shell-buffer-name
(org-babel-python-without-earmuffs py-buffer)))
(run-python cmd)
-
(sleep-for 0 10)))
+ (with-current-buffer py-buffer
+ (while (not python-shell--first-prompt-received)
+ (accept-process-output (get-buffer-process (current-buffer)))))
+ ))
((and (eq 'python-mode org-babel-python-mode)
(fboundp 'py-shell)) ; python-mode.el
(require 'python-mode)
|
[Prev in Thread] | Current Thread | [Next in Thread] |