}
} catch (FileNotFoundException fnfe) {
if (absPath.isDirectory()) {
throw Py.IOError(Errno.EISDIR, name);
}
if ((writing && !absPath.canWrite())
|| fnfe.getMessage().endsWith("(Permission denied)")) {
throw Py.IOError(Errno.EACCES, name);
}
throw Py.IOError(Errno.ENOENT, name);
}