emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 9714545 3/3: Work around w32-python-2.x bug to fix


From: Noam Postavsky
Subject: [Emacs-diffs] master 9714545 3/3: Work around w32-python-2.x bug to fix prompt detection (Bug#21376)
Date: Sun, 20 Aug 2017 16:42:32 -0400 (EDT)

branch: master
commit 9714545675af046d730352eb03dc00e93b6f7d3c
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Work around w32-python-2.x bug to fix prompt detection (Bug#21376)
    
    * 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 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 6f16912..e73b2a8 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]