isislovecruft/python-gnupg — pull request #69 by charles-dyfis-net (2014-10-02 01:08:01+00:00)
Title: Continue search for a usable binary if entries are symlinks

Existing code gives up searching for a GnuPG executable (returning None --
contrary to the docstring indicating that a RuntimeError will be thrown in all
cases where no binary can be found) if the first item found is a symlink or is
not accessed via an absolute path.

This refactored version moves the filtering logic down into the _which helper
-- and thus continues to search past unacceptable results -- even if the first
item found is not acceptable.