Show More
@@ -541,11 +541,15 b' class ui(object):' | |||||
541 | # e.g. color extension on Windows |
|
541 | # e.g. color extension on Windows | |
542 | self.write(prompt) |
|
542 | self.write(prompt) | |
543 |
|
543 | |||
544 |
# instead of trying to emulate raw_input, swap self.fin |
|
544 | # instead of trying to emulate raw_input, swap (self.fin, | |
545 | old = sys.stdin |
|
545 | # self.fout) with (sys.stdin, sys.stdout) | |
|
546 | oldin = sys.stdin | |||
|
547 | oldout = sys.stdout | |||
546 | sys.stdin = self.fin |
|
548 | sys.stdin = self.fin | |
|
549 | sys.stdout = self.fout | |||
547 | line = raw_input(' ') |
|
550 | line = raw_input(' ') | |
548 | sys.stdin = old |
|
551 | sys.stdin = oldin | |
|
552 | sys.stdout = oldout | |||
549 |
|
553 | |||
550 | # When stdin is in binary mode on Windows, it can cause |
|
554 | # When stdin is in binary mode on Windows, it can cause | |
551 | # raw_input() to emit an extra trailing carriage return |
|
555 | # raw_input() to emit an extra trailing carriage return |
General Comments 0
You need to be logged in to leave comments.
Login now