equal
deleted
inserted
replaced
168 |
168 |
169 def termwidth(): |
169 def termwidth(): |
170 try: |
170 try: |
171 # Query stderr to avoid problems with redirections |
171 # Query stderr to avoid problems with redirections |
172 screenbuf = win32console.GetStdHandle(win32console.STD_ERROR_HANDLE) |
172 screenbuf = win32console.GetStdHandle(win32console.STD_ERROR_HANDLE) |
|
173 if screenbuf is None: |
|
174 return 79 |
173 try: |
175 try: |
174 window = screenbuf.GetConsoleScreenBufferInfo()['Window'] |
176 window = screenbuf.GetConsoleScreenBufferInfo()['Window'] |
175 width = window.Right - window.Left |
177 width = window.Right - window.Left |
176 return width |
178 return width |
177 finally: |
179 finally: |