From c81dba2fb9c01240dfe4b0c2b04026f268cd7201 Mon Sep 17 00:00:00 2001 From: Jack Kamm Date: Wed, 30 Aug 2023 21:38:09 -0700 Subject: [PATCH] ob-python: Fix hanging on second start See: https://list.orgmode.org/87ttsnh5bx.fsf@localhost/T/#t * lisp/ob-python.el (org-babel-python-initiate-session-by-key): Switch from `org-babel-comint-wait-for-output' to `sleep-for' while waiting for `org-babel-python--initialized', to prevent hanging on restarted Python process. --- lisp/ob-python.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ob-python.el b/lisp/ob-python.el index c19af0ab3..6c05d1c8b 100644 --- a/lisp/ob-python.el +++ b/lisp/ob-python.el @@ -235,7 +235,7 @@ then create. Return the initialized session." ;; multiple prompts during initialization. (with-current-buffer py-buffer (while (not org-babel-python--initialized) - (org-babel-comint-wait-for-output py-buffer))) + (sleep-for 0 10))) (org-babel-comint-wait-for-output py-buffer)) (setq org-babel-python-buffers (cons (cons session py-buffer)