   ;; BAW - should undo be disabled in the python process buffer, if
   ;; this bug still exists?
   (interactive)
+  (if (null py-which-shell)
+      (cond ((eq py-default-interpreter 'cpython)
+	     (setq py-which-shell py-python-command
+		   py-which-args py-python-command-args))
+	    ((eq py-default-interpreter 'jpython)
+	     (setq py-which-shell py-jpython-command
+		   py-which-args py-jpython-command-args))
+	    (t (error "Illegal value for `py-default-interpreter': %s"
+		      py-default-interpreter))))
   (switch-to-buffer-other-window
    (apply 'make-comint py-which-bufname py-which-shell nil py-which-args))
   (make-local-variable 'comint-prompt-regexp)

(defcustom py-jpython-command "jpython"
  "*Shell command used to start the JPython interpreter."
  :type 'string
  :group 'python)

(defcustom py-python-command-args '("-i")

(make-variable-buffer-local 'py-output-buffer)

;; for toggling between CPython and JPython
(defvar py-which-shell nil)
(defvar py-which-args  py-python-command-args)
(defvar py-which-bufname "Python")
(make-variable-buffer-local 'py-which-shell)
