avoid subprocess.check_output (only 2.7)