Catch WindowsError when initializing colorama.
This commit is contained in:
parent
01177e25f0
commit
3a22c05050
2 changed files with 9 additions and 1 deletions
|
@ -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)
|
Dosage 1.12 (released 4.3.2013)
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
|
|
|
@ -120,7 +120,7 @@ def init():
|
||||||
global _default_foreground, _default_background, _default_style
|
global _default_foreground, _default_background, _default_style
|
||||||
try:
|
try:
|
||||||
attrs = GetConsoleScreenBufferInfo().wAttributes
|
attrs = GetConsoleScreenBufferInfo().wAttributes
|
||||||
except ArgumentError:
|
except (ArgumentError, WindowsError):
|
||||||
_default_foreground = GREY
|
_default_foreground = GREY
|
||||||
_default_background = BLACK
|
_default_background = BLACK
|
||||||
_default_style = NORMAL
|
_default_style = NORMAL
|
||||||
|
|
Loading…
Reference in a new issue