def decode_path_output(s):
    if sys.version_info[0] < 3:
        return s  # no need to decode, and safer not to do it
    # we don't really know in which encoding pkgconfig
    # outputs its results, so we try to guess
    for encoding in (sys.getfilesystemencoding(),
                     sys.getdefaultencoding(),
                     'utf8'):
        try:
            return s.decode(encoding)
        except __HOLE__: pass
    return s.decode('iso8859-1')


# try to find LuaJIT installation using pkgconfig
dataset/ETHPy150Open scoder/lupa/setup.py/decode_path_output