Fixing check_output for python 3