@contextmanager
def raise_on_eof(infile):
  try:
    yield
  except __HOLE__:
    filename = getattr(infile, 'name', None) or repr(infile)
    raise ParseError("Unexpected end-of-file parsing {0}".format(filename))
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/backend/jvm/tasks/jvm_compile/analysis_parser.py/raise_on_eof