Issue 1099

This commit is contained in:
Thomas Nagy 2012-01-08 18:13:50 +01:00
parent 20dc47b4e9
commit 72efb7867b
1 changed files with 6 additions and 1 deletions

View File

@ -28,6 +28,8 @@ except Exception:
else:
import re, threading
is_vista = getattr(sys, "getwindowsversion", None) and sys.getwindowsversion()[0] >= 6
try:
_type = unicode
except:
@ -162,7 +164,10 @@ else:
windll.kernel32.GetConsoleScreenBufferInfo(self.hconsole, byref(sbinfo))
attr = sbinfo.Attributes
for c in cols:
c = to_int(c, 0)
if is_vista:
c = to_int(c)
else:
c = to_int(c, 0)
if c in range(30,38): # fgcolor
attr = (attr & 0xfff0) | self.rgb2bgr(c-30)
elif c in range(40,48): # bgcolor