From 17be89674448d4898f4a576b6c1f98865dc8566c Mon Sep 17 00:00:00 2001 From: Justin Unwin Date: Mon, 10 Jun 2013 22:51:49 +0200 Subject: [PATCH] Fix a problem caused when a nonstandard stdout is defined and not properly implemented --- rq/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rq/utils.py b/rq/utils.py index 5fa4940..c5d50cf 100644 --- a/rq/utils.py +++ b/rq/utils.py @@ -69,8 +69,11 @@ class _Colorizer(object): self.codes["darkyellow"] = self.codes["brown"] self.codes["fuscia"] = self.codes["fuchsia"] self.codes["white"] = self.codes["bold"] - self.notty = not sys.stdout.isatty() + try: + self.notty = not sys.stdout.isatty() + except: + self.notty = True def reset_color(self): return self.codes["reset"]