Skip to content

Commit

Permalink
Check for fileno on stdout and use __stdout__ if appropriate (mozrunn…
Browse files Browse the repository at this point in the history
…er).
  • Loading branch information
Tony Young authored and admc committed Feb 5, 2011
1 parent c258dd1 commit 4c5dd8b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion windmill/dep/_mozrunner/runner.py
Expand Up @@ -53,7 +53,10 @@

def run_command(cmd, env=None):
"""Run the given command in killable process."""
kwargs = {'stdout':sys.stdout ,'stderr':sys.stderr, 'stdin':sys.stdin}
if hasattr(sys.stdout, "fileno"):
kwargs = {'stdout':sys.stdout ,'stderr':sys.stderr, 'stdin':sys.stdin}
else:
kwargs = {'stdout':sys.__stdout__ ,'stderr':sys.__stderr__, 'stdin':sys.stdin}

if sys.platform != "win32":
return killableprocess.Popen(cmd, preexec_fn=lambda : os.setpgid(0, 0), env=env, **kwargs)
Expand Down

0 comments on commit 4c5dd8b

Please sign in to comment.