def fix_frame_records_filenames(records):
fixed_records = []<EOL>for frame, filename, line_no, func_name, lines, index in records:<EOL><INDENT>better_fn = frame.f_globals.get('<STR_LIT>', None)<EOL>if isinstance(better_fn, str):<EOL><INDENT>filename = better_fn<EOL><DEDENT>fixed_records.append((frame, filename, line_no, func_name, lines, index))<EOL><DEDENT>return fixed_records<EOL>
Try to fix the filenames in each record from inspect.getinnerframes().

    Particularly, modules loaded from within zip files have useless filenames
    attached to their code object, and inspect.getinnerframes() just uses it.