emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 06373a6438: ob-python: Fix Emacs bug#50514 when Pyt


From: ELPA Syncer
Subject: [elpa] externals/org 06373a6438: ob-python: Fix Emacs bug#50514 when Python loads slowly
Date: Sat, 27 Aug 2022 22:57:51 -0400 (EDT)

branch: externals/org
commit 06373a64387330d5bbdcbb3417cea7c2638713df
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>

    ob-python: Fix Emacs bug#50514 when Python loads slowly
    
    * lisp/ob-python.el (org-babel-python-initiate-session-by-key): Do not
    rely on 10ms delay to initialize Python.  Wait until python process is
    initialized using `org-babel-comint-wait-for-output'.
---
 lisp/ob-python.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index 932aca08ec..e50a7c2e2e 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -197,8 +197,7 @@ then create.  Return the initialized session."
          (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)))
+         (run-python cmd)))
        ((and (eq 'python-mode org-babel-python-mode)
             (fboundp 'py-shell)) ; python-mode.el
        (require 'python-mode)
@@ -217,6 +216,8 @@ then create.  Return the initialized session."
          (py-shell nil nil t org-babel-python-command py-buffer nil nil t 
nil)))
        (t
        (error "No function available for running an inferior Python")))
+      ;; Wait until Python initializes.
+      (org-babel-comint-wait-for-output py-buffer)
       (setq org-babel-python-buffers
            (cons (cons session py-buffer)
                  (assq-delete-all session org-babel-python-buffers)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]