mercurial/posix.py
changeset 14165 78bdfc756908
parent 14004 97ed99d1f419
child 14231 8abe4db2d162
equal deleted inserted replaced
14164:cb98fed52495 14165:78bdfc756908
   314                 except AttributeError:
   314                 except AttributeError:
   315                     continue
   315                     continue
   316                 if not os.isatty(fd):
   316                 if not os.isatty(fd):
   317                     continue
   317                     continue
   318                 arri = fcntl.ioctl(fd, termios.TIOCGWINSZ, '\0' * 8)
   318                 arri = fcntl.ioctl(fd, termios.TIOCGWINSZ, '\0' * 8)
   319                 return array.array('h', arri)[1]
   319                 width = array.array('h', arri)[1]
       
   320                 if width > 0:
       
   321                     return width
   320             except ValueError:
   322             except ValueError:
   321                 pass
   323                 pass
   322             except IOError, e:
   324             except IOError, e:
   323                 if e[0] == errno.EINVAL:
   325                 if e[0] == errno.EINVAL:
   324                     pass
   326                     pass