From 3a22c05050d1988d307dba05a4ebb2c5217901b6 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Tue, 5 Mar 2013 21:15:25 +0100 Subject: [PATCH] Catch WindowsError when initializing colorama. --- doc/changelog.txt | 8 ++++++++ dosagelib/colorama.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/changelog.txt b/doc/changelog.txt index a8e4bc3b5..59c4e255f 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -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: diff --git a/dosagelib/colorama.py b/dosagelib/colorama.py index 96dd1fa60..48777a361 100644 --- a/dosagelib/colorama.py +++ b/dosagelib/colorama.py @@ -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