From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: [PATCH] Fix ob-python.el initiate session error with py-shell Date: Tue, 18 Feb 2020 20:55:41 +0800 Message-ID: <877e0kjbqq.fsf@gmail.com> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:41349) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j42Pk-0000wV-TL for emacs-orgmode@gnu.org; Tue, 18 Feb 2020 07:55:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j42Pj-00070u-Qf for emacs-orgmode@gnu.org; Tue, 18 Feb 2020 07:55:48 -0500 Received: from [223.104.247.32] (port=23284 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j42Pi-00070B-A6 for emacs-orgmode@gnu.org; Tue, 18 Feb 2020 07:55:47 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: Org Mode --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable When I have a python src block like this: #+begin_src python :session "test" :results output print("hello, world") #+end_src It will report session error. This minor patch should fixed ~py-shell~ initiate Python session issue. =2D-=20 [ stardiviner ] I try to make every word tell the meaning what I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 =20=20=20=20=20=20 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-ob-python.el-org-babel-python-initiate-session-.patch Content-Transfer-Encoding: quoted-printable From=20fa39b7f3ad8aafe0fcebb27c5f695edf08820884 Mon Sep 17 00:00:00 2001 From: stardiviner Date: Tue, 18 Feb 2020 20:52:32 +0800 Subject: [PATCH] * lisp/ob-python.el (org-babel-python-initiate-session-by-key): fix ob-python.el initiate session issue. =2D-- lisp/ob-python.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ob-python.el b/lisp/ob-python.el index de718b04b..f67acf2f9 100644 =2D-- a/lisp/ob-python.el +++ b/lisp/ob-python.el @@ -207,8 +207,8 @@ (defun org-babel-python-initiate-session-by-key (&optio= nal session) "^\\*\\([^*]+\\)\\*$" "\\1" python-buffer) (concat "Python-" (symbol-name session)))) (py-which-bufname bufname)) =2D (py-shell) =2D (setq python-buffer (org-babel-python-with-earmuffs bufname)))) + (setq python-buffer (org-babel-python-with-earmuffs bufname)) + (py-shell nil nil t org-babel-python-command python-buffer nil nil t ni= l))) (t (error "No function available for running an inferior Python"))) (setq org-babel-python-buffers =2D-=20 2.25.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5L3s0UHG51bWJjaGls ZEBnbWFpbC5jb20ACgkQG13xyVromsPkVAf7B0s1mWouDaAQUbqywm3osa6p0vN5 HCco3Wp04sWuUpFF1N8XXYGFmQj6g4EeiiyToEoK5oeRldiyhCUmvnU6xeDOHiPj l6IjwT+g3omqDipUKZu8PJV4Xo9iUrUvBqz2XOat6movEPS7w63+Ctq7veN/B4Zb BI9RLIBZ8Zz4bOlkDkAR+YSWSBa7wIRb748srqgd0n/p7evZyA3NDZaf2ikIq4zI jT9/ylfqdDPzKinlhATkaOkZbNQ42WGS75S0wS9S2HWXRJJq+OxQHpYYQxGmhY5X RyuDZBLo86K2cB7nhczac4Frw71vr+d2zYEh5mYUz8CZJ05pusJ2zPT0cQ== =R9KI -----END PGP SIGNATURE----- --==-=-=--