File tree 2 files changed +20
-0
lines changed
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."
529
529
" Execute BODY according to PARAMS.
530
530
BODY is the code to execute for the current Jupyter `:session' in
531
531
the 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" ))))
532
537
(let* ((result-params (assq :result-params params))
533
538
(async-p (jupyter-org-execute-async-p params)))
534
539
(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\")
3102
3102
(sleep-for 0.1 ))
3103
3103
(funcall check-result " : 6" )))))
3104
3104
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
+
3105
3120
; ; Local Variables:
3106
3121
; ; byte-compile-warnings: (unresolved obsolete lexical)
3107
3122
; ; eval: (and (functionp 'aggressive-indent-mode) (aggressive-indent-mode -1))
You can’t perform that action at this time.
0 commit comments