def open_if_exists(filename, mode='rb'):
    """Returns a file descriptor for the filename if that file exists,
    otherwise `None`.
    """
    try:
        return open(filename, mode)
    except __HOLE__, e:
        if e.errno not in (errno.ENOENT, errno.EISDIR):
            raise
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/jinja2-2.6/jinja2/utils.py/open_if_exists