File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -529,6 +529,11 @@ These parameters are handled internally."
529529 " Execute BODY according to PARAMS.
530530BODY is the code to execute for the current Jupyter `:session' in
531531the PARAMS alist."
532+ (when org-babel-current-src-block-location
533+ (save-excursion
534+ (goto-char org-babel-current-src-block-location)
535+ (when (jupyter-org-request-at-point)
536+ (user-error " Source block currently being executed" ))))
532537 (let* ((result-params (assq :result-params params))
533538 (async-p (jupyter-org-execute-async-p params)))
534539 (when (member " replace" result-params)
Original file line number Diff line number Diff line change @@ -3102,6 +3102,21 @@ raise Exception(\"This is an error\")
31023102 (sleep-for 0.1 ))
31033103 (funcall check-result " : 6" )))))
31043104
3105+ (ert-deftest org-babel-prevent-multiple-executions ()
3106+ :tags '(org q)
3107+ (let ((src (format " \
3108+ #+BEGIN_SRC jupyter-python :session %s :async yes
3109+ 1
3110+ #+END_SRC
3111+ "
3112+ jupyter-org-test-session)))
3113+ (jupyter-org-test
3114+ (insert src)
3115+ (org-previous-block 1 )
3116+ (org-babel-execute-src-block )
3117+ (should (jupyter-org-request-at-point))
3118+ (should-error (org-babel-execute-src-block )))))
3119+
31053120; ; Local Variables:
31063121; ; byte-compile-warnings: (unresolved obsolete lexical)
31073122; ; eval: (and (functionp 'aggressive-indent-mode) (aggressive-indent-mode -1))
You can’t perform that action at this time.
0 commit comments