daler/pybedtools — pull request #66 by cswegger (2012-11-13 15:03:13+00:00)
Title: Use a more robust detection for samtools

isSAM() currently fails when using forks of samtools that write to stderr. In fact, checking for any stderr output is not very robust: this commit fixes the issue by using subprocess.check_call() and catching the exception in case the command does not return 0.

I tested it locally, works.