On Sun, Feb 22, 2009 at 09:57:22PM +0200, Dalius Dobravolskas wrote:

> Here is diff how I have avoided this problem:
> 
> --- io/terminalwriter.py    (revision 62015)
> +++ io/terminalwriter.py    (working copy)
> @@ -31,7 +31,7 @@
>      if file is None:
>          file = sys.stderr
>      text = text.rstrip()
> -    if esc and sys.platform != "win32" and file.isatty():
> +    if esc and sys.platform != "win32" and 'isatty' in dir(file) and 
> file.isatty():

Please use hasattr(log, 'isatty') instead.

>          if not isinstance(esc, tuple):
>              esc = (esc,)
>          text = (''.join(['\x1b[%sm' % cod for cod in esc])  + 

Marius Gedminas
-- 
I am a computer. I am dumber than any human and smarter than any administrator.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
[email protected]
http://codespeak.net/mailman/listinfo/pypy-dev

Reply via email to