ob-python: Insert blank line when sending code to interpreter
commit1966d58b253d0077025589c736b9223010682e17
authorGong Qijian <gongqijian@gmail.com>
Sun, 1 Apr 2018 08:34:32 +0000 (1 16:34 +0800)
committerNicolas Goaziou <mail@nicolasgoaziou.fr>
Tue, 3 Apr 2018 19:24:18 +0000 (3 21:24 +0200)
tree320833f7d97d2b218c1de831af98a0ea13ee546d
parentb1a6395dfeadd9adc5ce7633f341dfbbb30bd39e
ob-python: Insert blank line when sending code to interpreter

* lisp/ob-python.el (org-bable-python-evaluate-session):

Syntax error occurs when evaluating the following code block:

\#+begin_src python :session
if True:
    1
2
\#+end_src

A blank line is required for top level module code to end an indented block, such as a for loop, try/except, or if statement.

https://www.python.org/dev/peps/pep-0008/#blank-line

TINYCHANGE
lisp/ob-python.el
testing/lisp/test-ob-python.el