I've added comment and test (New path file in attachment),the test results look fine. #+BEGIN_SRC sh $ make BTEST_RE="test-ob-python" test-dirty ... selected tests: test-ob-python Running 7 tests (2018-04-03 16:51:31+0800) executing Python code block... Code block evaluation complete. passed 1/7 test-ob-python/colnames-nil-header-argument executing Python code block... Code block evaluation complete. passed 2/7 test-ob-python/colnames-no-header-argument executing Python code block... Code block evaluation complete. passed 3/7 test-ob-python/colnames-no-header-argument-again executing Python code block... Code block evaluation complete. passed 4/7 test-ob-python/colnames-yes-header-argument executing Python code block... Code block evaluation complete. passed 5/7 test-ob-python/colnames-yes-header-argument-again executing Python code block... Code block evaluation complete. passed 6/7 test-ob-python/insert-necessary-blank-line-when-sending-code-to-interpreter executing Python code block... Code block evaluation complete. passed 7/7 test-ob-python/session-multiline Ran 7 tests, 7 results as expected (2018-04-03 16:51:33+0800) #+END_SRC Nicolas Goaziou 于2018年4月3日 周二上午2:56写道: > Hello, > > qijian gong writes: > > > I've written this patch to fix the syntax error alarm caused by > evaluating > > the following code block: > > > > #+BEGIN_SRC python :session > > if True: > > 1 > > 2 > > #+END_SRC > > Thank you. > > Could you add a test in "test-ob-python.el"? Could you also add > a comment explaining what you are doing? > > > + (let ((curr-indent (string-match "[^\s]" line))) > > (string-match "\\S-" line) > > Regards, > > -- > Nicolas Goaziou >