mercurial/win32.py
branchstable
changeset 13285 2ef915184ff2
parent 12966 5f80f44d23c5
child 13374 1c613c1ae43d
--- a/mercurial/win32.py	Sun Jan 09 00:35:36 2011 +0900
+++ b/mercurial/win32.py	Fri Jan 21 14:42:15 2011 -0600
@@ -170,6 +170,8 @@
     try:
         # Query stderr to avoid problems with redirections
         screenbuf = win32console.GetStdHandle(win32console.STD_ERROR_HANDLE)
+        if screenbuf is None:
+            return 79
         try:
             window = screenbuf.GetConsoleScreenBufferInfo()['Window']
             width = window.Right - window.Left