def is_same_py_file(file_1, file_2):
    """Compares 2 filenames accounting for .pyc files."""
    if file_1.endswith('.pyc') or file_1.endswith('.pyo'):
        file_1 = file_1[:-1]
    if file_2.endswith('.pyc') or file_2.endswith('.pyo'):
        file_2 = file_2[:-1]

    return file_1 == file_2