comparison mercurial/ui.py @ 22291:3b39e1522d8f

ui: add brief comment why raw_input() needs dummy ' ' prompt string Retrieved from 17ffb30d9174. I was about to move ' ' to label(msg + ' ', 'ui.prompt') so that subclass can distinguish prompt output from data. But it was not that simple.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 24 Aug 2014 12:35:53 +0900
parents 9fa429723f26
children fdfc9faca273
comparison
equal deleted inserted replaced
22290:dcb95aadf850 22291:3b39e1522d8f
624 # self.fout) with (sys.stdin, sys.stdout) 624 # self.fout) with (sys.stdin, sys.stdout)
625 oldin = sys.stdin 625 oldin = sys.stdin
626 oldout = sys.stdout 626 oldout = sys.stdout
627 sys.stdin = self.fin 627 sys.stdin = self.fin
628 sys.stdout = self.fout 628 sys.stdout = self.fout
629 # prompt ' ' must exist; otherwise readline may delete entire line
630 # - http://bugs.python.org/issue12833
629 line = raw_input(' ') 631 line = raw_input(' ')
630 sys.stdin = oldin 632 sys.stdin = oldin
631 sys.stdout = oldout 633 sys.stdout = oldout
632 634
633 # When stdin is in binary mode on Windows, it can cause 635 # When stdin is in binary mode on Windows, it can cause