Gestion du cas ou ne peut pas demander les proprietes du terminal.
Par exemple lors d'un push. darcs-hash:20071218004712-af139-54dc08defd43e8fec7cfbd03ea1ea212b2e3d7ad.gz
This commit is contained in:
parent
190a0512ab
commit
20d5ced53f
1 changed files with 4 additions and 1 deletions
|
@ -29,7 +29,10 @@ __all__ = ["getch", "ask", "Exit"]
|
|||
|
||||
def getch():
|
||||
fd = sys.stdin.fileno()
|
||||
mode = termios.tcgetattr(fd)
|
||||
try:
|
||||
mode = termios.tcgetattr(fd)
|
||||
except:
|
||||
return os.read(fd, 1)
|
||||
try:
|
||||
tty.setraw(fd)
|
||||
return os.read(fd, 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue