Uses pty module to capture colored text from Sphinx.

If pty module is unavailable, captures text from pipe.