diff --git a/pym/cl_utils2.py b/pym/cl_utils2.py index fb03398..193cf2d 100644 --- a/pym/cl_utils2.py +++ b/pym/cl_utils2.py @@ -374,7 +374,11 @@ class cl_smartcon(object): """Получить ширину текущей консоли""" s = struct.pack("HHHH", 0, 0, 0, 0) fd_stdout = sys.stdout.fileno() - x = fcntl.ioctl(fd_stdout, termios.TIOCGWINSZ, s) + try: + x = fcntl.ioctl(fd_stdout, termios.TIOCGWINSZ, s) + except IOError: + # если ошибка то ширина 80 символов + return 80 #(rows, cols, x pixels, y pixels) return struct.unpack("HHHH", x)[1]