def isfile_strict(path):
    try:
        st = os.stat(path)
    except OSError:
        err = sys.exc_info()[1]
        if err.errno in (errno.EPERM, errno.EACCES):
            raise
        return False
    else:
        return stat.S_ISREG(st.st_mode)


# --- constants
Same as os.path.isfile() but does not swallow EACCES / EPERM
dataset/ETHPy150Open packages/psutil/psutil/_common.py/isfile_strict