Safter isatty check

I hit this when running some tests under `nose` with the `xunit` plugin. The plugin replaced `sys.stdout` with it's `Tee` object that as of version 1.3.0 did not implement `isatty`.