Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 7496:0a27d0db256d
issue1419: catch strange readline import error on windows
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Tue, 09 Dec 2008 17:01:14 -0800 |
parents | 8dca507e56ce |
children | f598df061fec |
comparison
equal
deleted
inserted
replaced
7494:85dc88630beb | 7496:0a27d0db256d |
---|---|
405 # magically add command line editing support, where | 405 # magically add command line editing support, where |
406 # available | 406 # available |
407 import readline | 407 import readline |
408 # force demandimport to really load the module | 408 # force demandimport to really load the module |
409 readline.read_history_file | 409 readline.read_history_file |
410 except ImportError: | 410 # windows sometimes raises something other than ImportError |
411 except Exception: | |
411 pass | 412 pass |
412 line = raw_input(prompt) | 413 line = raw_input(prompt) |
413 # When stdin is in binary mode on Windows, it can cause | 414 # When stdin is in binary mode on Windows, it can cause |
414 # raw_input() to emit an extra trailing carriage return | 415 # raw_input() to emit an extra trailing carriage return |
415 if os.linesep == '\r\n' and line and line[-1] == '\r': | 416 if os.linesep == '\r\n' and line and line[-1] == '\r': |