TK Soh wrote:
> It looks like the "closed" attribute for sys.stderr and sys.stdout are
> missing when win32trace is in effect. Any way to work around this?
>   

I have no idea about win32traceutil, but the sys module provides 
sys.__stdout__ and sys.__stderr__ so that even when modules replace the 
streams with custom objects you can still access the originals. This may 
or may not be helpful...

Michael Foord
http://www.manning.com/foord

> python script:
> --------------------------
> import win32traceutil
> import sys
> if not sys.stdout.closed:
>     print "stdout is opened"
> --------------------------
>
> Trace collector output:
> --------------------------
> Traceback (most recent call last):
>   File "try.py", line 3, in <module>
>     if not sys.stdout.closed:
> AttributeError: 'PyTraceObject' object has no attribute 'closed'
> _______________________________________________
> python-win32 mailing list
> python-win32@python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
>   

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to