fix UnicodeEncode error when using pause module with unicode prompt.

This commit is contained in:
WAKAYAMA shirou 2014-05-22 00:21:14 +09:00
parent 346bb611c7
commit 56880b76bb

View file

@ -101,7 +101,7 @@ class ActionModule(object):
# Clear out any unflushed buffered input which would # Clear out any unflushed buffered input which would
# otherwise be consumed by raw_input() prematurely. # otherwise be consumed by raw_input() prematurely.
tcflush(sys.stdin, TCIFLUSH) tcflush(sys.stdin, TCIFLUSH)
self.result['user_input'] = raw_input(self.prompt) self.result['user_input'] = raw_input(self.prompt.encode(sys.stdout.encoding))
except KeyboardInterrupt: except KeyboardInterrupt:
while True: while True:
print '\nAction? (a)bort/(c)ontinue: ' print '\nAction? (a)bort/(c)ontinue: '