]> git.eshelyaron.com Git - emacs.git/commitdiff
Work around w32-python-2.x bug to fix prompt detection (Bug#21376)
authorNoam Postavsky <npostavs@gmail.com>
Tue, 15 Aug 2017 21:49:10 +0000 (17:49 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Sun, 20 Aug 2017 20:43:37 +0000 (16:43 -0400)
* lisp/progmodes/python.el (python-shell-prompt-detect): Don't put
carriage returns into the temporary file when running in unbuffered
mode, the w32 build of python 2.7 chokes on them.

lisp/progmodes/python.el

index 6f169123b95fba9dfc76fbea9b94ca22969610bb..e73b2a8488cecef49f105bf3feceef5903302474 100644 (file)
@@ -2245,7 +2245,11 @@ detection and just returns nil."
                 ;; `condition-case' and displaying the error message to
                 ;; the user in the no-prompts warning.
                 (ignore-errors
-                  (let ((code-file (python-shell--save-temp-file code)))
+                  (let ((code-file
+                         ;; Python 2.x on Windows does not handle
+                         ;; carriage returns in unbuffered mode.
+                         (let ((inhibit-eol-conversion (getenv "PYTHONUNBUFFERED")))
+                           (python-shell--save-temp-file code))))
                     ;; Use `process-file' as it is remote-host friendly.
                     (process-file
                      interpreter