def _redefines_import(node):
    'Detect that the given node (AssignName) is inside an\n    exception handler and redefines an import from the tryexcept body.\n    Returns True if the node redefines an import, False otherwise.\n    '
    current = node
    while (current and (not isinstance(current.parent, astroid.ExceptHandler))):
        current = current.parent
    if ((not current) or (not utils.error_of_type(current.parent, ImportError))):
        return False
    try_block = current.parent.parent
    for import_node in try_block.nodes_of_class((astroid.ImportFrom, astroid.Import)):
        for (name, alias) in import_node.names:
            if alias:
                if (alias == node.name):
                    return True
            elif (name == node.name):
                return True
    return False
Detect that the given node (AssignName) is inside an
exception handler and redefines an import from the tryexcept body.
Returns True if the node redefines an import, False otherwise.
def _redefines_import(node):
    'Detect that the given node (AssignName) is inside an\n    exception handler and redefines an import from the tryexcept body.\n    Returns True if the node redefines an import, False otherwise.\n    '
    current = node
    while (current and (not isinstance(current.parent, astroid.ExceptHandler))):
        current = current.parent
    if ((not current) or (not utils.error_of_type(current.parent, ImportError))):
        return False
    try_block = current.parent.parent
    for import_node in try_block.nodes_of_class((astroid.ImportFrom, astroid.Import)):
        for (name, alias) in import_node.names:
            if alias:
                if (alias == node.name):
                    return True
            elif (name == node.name):
                return True
    return False