def _iter_cache(cachefile, gpstype=LIGOTimeGPS):
try:<EOL><INDENT>path = os.path.abspath(cachefile.name)<EOL><DEDENT>except AttributeError:<EOL><INDENT>path = None<EOL><DEDENT>for line in cachefile:<EOL><INDENT>try:<EOL><INDENT>yield _CacheEntry.parse(line, gpstype=LIGOTimeGPS)<EOL><DEDENT>except ValueError:<EOL><INDENT>parts = line.split()<EOL>if len(parts) == <NUM_LIT:3> and os.path.abspath(parts[<NUM_LIT:0>]) != path:<EOL><INDENT>with open(parts[<NUM_LIT:0>], '<STR_LIT:r>') as cache2:<EOL><INDENT>for entry in _iter_cache(cache2):<EOL><INDENT>yield entry<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>raise<EOL><DEDENT><DEDENT><DEDENT>
Internal method that yields a `_CacheEntry` for each line in the file

    This method supports reading LAL- and (nested) FFL-format cache files.