Non-raising listdir.

def _listdir(pth, extensions):
    """Non-raising listdir."""
    try:
        return [fname for fname in os.listdir(pth)
                if os.path.splitext(fname)[1] in extensions]
    except OSError:  # pragma: nocover
        pass