Catch WindowsError when initializing colorama.

This commit is contained in:
Bastian Kleineidam 2013-03-05 21:15:25 +01:00
parent 01177e25f0
commit 3a22c05050
2 changed files with 9 additions and 1 deletions

View file

@ -1,3 +1,11 @@
Dosage 1.13 (released xx.xx.2013)
Fixes:
- cmdline: Catch error when piping output to another
program or file under Windows.
Closes: GH bug #13
Dosage 1.12 (released 4.3.2013)
Features:

View file

@ -120,7 +120,7 @@ def init():
global _default_foreground, _default_background, _default_style
try:
attrs = GetConsoleScreenBufferInfo().wAttributes
except ArgumentError:
except (ArgumentError, WindowsError):
_default_foreground = GREY
_default_background = BLACK
_default_style = NORMAL