mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
posix: workaround lack of TIOCGWINSZ on Irix (issue3449)
On an Irix 6.5.24 system, TIOCGWINSZ is not available. This means that any usage of the "hg" tool that looks up the terminal size (e.g. "hg help") will fail with an AttributeError. A simple work-around is just to wrap this block in mercurial/posix.py with a try/except so that it ends up using the default 80 characters width.
This commit is contained in:
parent
dbfb64e582
commit
7b5857715d
@ -409,10 +409,13 @@ def termwidth():
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user