Some additions to your travis-hangs PR

1) Explicitly import `print_function` from `__future__`
2) Simplify the string matching business

I had already merged in Mark's PR when I was checking out yours; only the last two commits are really relevant here.