Skip to content

Commit

Permalink
on win32 sys.stdout can be a "Blackhole" when we make a GUI applicati…
Browse files Browse the repository at this point in the history
…on, and it does not have a fileno, so we can't colourify it

git-svn-id: https://xpra.org/svn/Xpra/trunk@11160 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Nov 9, 2015
1 parent d025788 commit cd73e1b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/xpra/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ def setloghandler(lh):
logging.root.addHandler(lh)

def enable_color(to=sys.stdout, formatter=NOPREFIX_FORMAT):
if not hasattr(to, "fileno"):
#on win32 sys.stdout can be a "Blackhole",
#which does not have a fileno
return
from xpra.colorstreamhandler import ColorStreamHandler
from logging import Formatter
csh = ColorStreamHandler(to)
Expand Down

0 comments on commit cd73e1b

Please sign in to comment.