def _six_fail_hook(modname):
attribute_of = modname != "<STR_LIT>" and modname.startswith("<STR_LIT>")<EOL>if modname != "<STR_LIT>" and not attribute_of:<EOL><INDENT>raise AstroidBuildingError(modname=modname)<EOL><DEDENT>module = AstroidBuilder(MANAGER).string_build(_IMPORTS)<EOL>module.name = "<STR_LIT>"<EOL>if attribute_of:<EOL><INDENT>start_index = len(module.name)<EOL>attribute = modname[start_index:].lstrip("<STR_LIT:.>").replace("<STR_LIT:.>", "<STR_LIT:_>")<EOL>try:<EOL><INDENT>import_attr = module.getattr(attribute)[<NUM_LIT:0>]<EOL><DEDENT>except AttributeInferenceError:<EOL><INDENT>raise AstroidBuildingError(modname=modname)<EOL><DEDENT>if isinstance(import_attr, nodes.Import):<EOL><INDENT>submodule = MANAGER.ast_from_module_name(import_attr.names[<NUM_LIT:0>][<NUM_LIT:0>])<EOL>return submodule<EOL><DEDENT><DEDENT>return module<EOL>
Fix six.moves imports due to the dynamic nature of this
    class.

    Construct a pseudo-module which contains all the necessary imports
    for six

    :param modname: Name of failed module
    :type modname: str

    :return: An astroid module
    :rtype: nodes.Module