##// END OF EJS Templates
util.termwidth: a file-like object may legitimately lack a fileno() method...
Bryan O'Sullivan -
r8347:a3826fff default
parent child Browse files
Show More
@@ -1438,7 +1438,10 b' def termwidth():'
1438 import termios, array, fcntl
1438 import termios, array, fcntl
1439 for dev in (sys.stdout, sys.stdin):
1439 for dev in (sys.stdout, sys.stdin):
1440 try:
1440 try:
1441 fd = dev.fileno()
1441 try:
1442 fd = dev.fileno()
1443 except AttributeError:
1444 continue
1442 if not os.isatty(fd):
1445 if not os.isatty(fd):
1443 continue
1446 continue
1444 arri = fcntl.ioctl(fd, termios.TIOCGWINSZ, '\0' * 8)
1447 arri = fcntl.ioctl(fd, termios.TIOCGWINSZ, '\0' * 8)
General Comments 0
You need to be logged in to leave comments. Login now