Remove use of check_output to maintain compatibility with python 2.6