Source

prog-modes / pydoc.el

Diff from to

File pydoc.el

 			   " *Python Command*"))
     (if (buffer-live-p (get-buffer input-buf-name))
 	(bury-buffer input-buf-name))
+
+    ;; current vintages of python-mode.el (4.6 at least)
+    ;; no longer return a buffer [name].  We get t from the
+    ;; final kill-buffer instead.  If we see t we use try to
+    ;; guess a good buffer name.
+    (if (eq output-buf-name t)
+	(setq output-buf-name (if async-process
+				  (buffer-name (process-buffer async-process))
+				"*Python Output*")))
+
     (if (or (null output-buf-name)
 	    ;; In earlier versions of python-mode.el, py-execute-string does
 	    ;; not return a buffer name.
 
 pydoc_lisp.pydoc_output_lisp()
 "))
+      ;; current vintages of python-mode.el (4.6 at least)
+      ;; no longer return a buffer [name].  We get t from the
+      ;; final kill-buffer instead.  If we see t we use the
+      ;; python shell's buffer.
+      (if (eq output-buf t)
+	  (setq output-buf 
+		(buffer-name (process-buffer (pydoc-async-output-p)))))
+
       (setq pydoc-alist (pydoc-lisp-read-result output-buf)))
     (if (member pydoc-alist '(nil None Traceback))
 	(progn