branch | stable |
changeset 16726 | 7002bb17cc5e |
parent 16383 | f5dd179bfa4a |
child 17203 | 0cb55b5c19a3 |
--- a/mercurial/posix.py Mon May 14 12:56:43 2012 +0200 +++ b/mercurial/posix.py Mon May 14 13:25:42 2012 +0100 @@ -409,10 +409,13 @@ continue if not os.isatty(fd): continue - arri = fcntl.ioctl(fd, termios.TIOCGWINSZ, '\0' * 8) - width = array.array('h', arri)[1] - if width > 0: - return width + try: + arri = fcntl.ioctl(fd, termios.TIOCGWINSZ, '\0' * 8) + width = array.array('h', arri)[1] + if width > 0: + return width + except AttributeError: + pass except ValueError: pass except IOError, e: