##// END OF EJS Templates
ui: call write() so the prompt string goes through subclassed implementation
Idan Kamara -
r15000:68b5d700 stable
parent child Browse files
Show More
@@ -537,12 +537,15 b' class ui(object):'
537 except Exception:
537 except Exception:
538 pass
538 pass
539
539
540 # instead of trying to emulate raw_input, swap our in/out
540 # call write() so output goes through subclassed implementation
541 # with sys.stdin/out
541 # e.g. color extension on Windows
542 old = sys.stdout, sys.stdin
542 self.write(prompt)
543 sys.stdout, sys.stdin = self.fout, self.fin
543
544 line = raw_input(prompt)
544 # instead of trying to emulate raw_input, swap self.fin with sys.stdin
545 sys.stdout, sys.stdin = old
545 old = sys.stdin
546 sys.stdin = self.fin
547 line = raw_input()
548 sys.stdin = old
546
549
547 # When stdin is in binary mode on Windows, it can cause
550 # When stdin is in binary mode on Windows, it can cause
548 # raw_input() to emit an extra trailing carriage return
551 # raw_input() to emit an extra trailing carriage return
General Comments 0
You need to be logged in to leave comments. Login now