From: "Grégoire Jadi" <gregoire.jadi@univ-nantes.fr>
To: Orgmode <emacs-orgmode@gnu.org>
Subject: [PATCH] ob-python: Fix python session initialization
Date: Wed, 30 Sep 2015 10:01:38 +0200 [thread overview]
Message-ID: <87wpv8xrml.fsf@univ-nantes.fr> (raw)
[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]
Hi,
There is a bug in ob-python, the parameters aren't used to initialize
the session. Here is a patch that fixes it.
OK to push ?
* lisp/ob-python.el (org-babel-execute:python): Send params to `org-babel-python-initiate-session'.
It was not possible to configure the sesssion with custom parameters.
For example, the python interpreter with :python
> BEGIN_SRC python :session my-session :python ipython
---
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 3a9b8f6..f2e6f66 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -74,7 +74,7 @@ This will typically be either `python' or `python-mode'."
"Execute a block of Python code with Babel.
This function is called by `org-babel-execute-src-block'."
(let* ((session (org-babel-python-initiate-session
- (cdr (assoc :session params))))
+ (cdr (assoc :session params)) params))
(result-params (cdr (assoc :result-params params)))
(result-type (cdr (assoc :result-type params)))
(return-val (when (and (eq result-type 'value) (not session))
--
--
Grégoire Jadi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
next reply other threads:[~2015-09-30 8:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-30 8:01 Grégoire Jadi [this message]
2015-09-30 8:26 ` [PATCH] ob-python: Fix python session initialization Grégoire Jadi
2015-10-29 14:08 ` Aaron Ecay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wpv8xrml.fsf@univ-nantes.fr \
--to=gregoire.jadi@univ-nantes.fr \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).