summaryrefslogtreecommitdiff
path: root/scripts/download_import_cldr.py
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2013-07-06 14:40:29 +0200
committerArmin Ronacher <armin.ronacher@active-4.com>2013-07-06 14:40:29 +0200
commit508e891537201fb4da515f9668157850b752df02 (patch)
treeb1be69db90191c4162ec7dafb929ff425e025e2a /scripts/download_import_cldr.py
parent094a9927d8ef837eebfd096d88380c45e24e6f06 (diff)
downloadbabel-508e891537201fb4da515f9668157850b752df02.tar.gz
Added a terminal width fallback
Diffstat (limited to 'scripts/download_import_cldr.py')
-rwxr-xr-xscripts/download_import_cldr.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/scripts/download_import_cldr.py b/scripts/download_import_cldr.py
index da4c1ef..b60a0e4 100755
--- a/scripts/download_import_cldr.py
+++ b/scripts/download_import_cldr.py
@@ -16,12 +16,15 @@ BLKSIZE = 131072
def get_terminal_width():
- import fcntl
- import termios
- import struct
- fd = sys.stdin.fileno()
- cr = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
- return cr[1]
+ try:
+ import fcntl
+ import termios
+ import struct
+ fd = sys.stdin.fileno()
+ cr = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
+ return cr[1]
+ except Exception:
+ return 80
def reporthook(block_count, block_size, total_size):