def get_compiler_by_path(path):
    for compiler in six.itervalues(get_compilers()):
        if compiler.is_supported(path):
            return compiler

    raise exceptions.UnsupportedFile(
        "The source file '{0}' is not supported by any of available compilers."
        .format(path))
def get_compiler_by_path(path):
    # type: (str) -> BaseCompiler
    for compiler in (six.itervalues(get_compilers()) if uses_six else get_compilers().values()):
        if compiler.is_supported(path):
            return compiler

    raise exceptions.UnsupportedFile(
        "The source file '{0}' is not supported by any of available compilers.".format(path)
    )