Skip to content
Snippets Groups Projects
Commit 0fc95f5cea57 authored by Martin Geisler's avatar Martin Geisler
Browse files

ui: also swap sys.stdout with self.fout in _readline

In 17ffb30d9174, _readline was changed to output a space using
raw_input and this was done using sys.stdout directly, not self.fout.

This change broke the command server for JavaHg since it (and other
clients) would see a spurious ' ' on stdout and interpret this as an
unknown channel.
parent 01cdfba22f0c
No related branches found
No related tags found
No related merge requests found
......@@ -541,6 +541,8 @@
# e.g. color extension on Windows
self.write(prompt)
# instead of trying to emulate raw_input, swap self.fin with sys.stdin
old = sys.stdin
# instead of trying to emulate raw_input, swap (self.fin,
# self.fout) with (sys.stdin, sys.stdout)
oldin = sys.stdin
oldout = sys.stdout
sys.stdin = self.fin
......@@ -546,2 +548,3 @@
sys.stdin = self.fin
sys.stdout = self.fout
line = raw_input(' ')
......@@ -547,5 +550,6 @@
line = raw_input(' ')
sys.stdin = old
sys.stdin = oldin
sys.stdout = oldout
# When stdin is in binary mode on Windows, it can cause
# raw_input() to emit an extra trailing carriage return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment